Skip to content

Commit

Permalink
Configure build to use modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Nov 8, 2020
1 parent e25cb0d commit 53c17a7
Show file tree
Hide file tree
Showing 30 changed files with 178 additions and 424 deletions.
30 changes: 12 additions & 18 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ stylesheet that closely resembles the original while being custom tailored for J
It's worth mentioning that Twitter Bootstrap delivers more than just a standardized look for common widgets. It also
provides new widgets, behavior and a grid system. Some of these features may be ported at a later stage to BootstrapFX.

There is an link:https://demos.jpro.one/bootstrapfx.html[online-version] available at link:https://www.jpro.one/[jpro.one].

== Installing

You can get the latest version of **BootstrapFX** directly from link:https://bintray.com[Bintray's JCenter] repository or Maven Central.
Expand All @@ -33,7 +31,7 @@ repositories {
}
dependencies {
compile '{project-group}:{project-name}-core:{project-version}'
implementation '{project-group}:{project-name}-core:{project-version}'
}
----

Expand All @@ -51,7 +49,7 @@ dependencies {
----

Once the `bootstrapfx-core` dependency is in your classpath you just need to apply the `boostrapfx.css` stylesheet to
an scene, for example
a scene, for example

[source,java]
----
Expand Down Expand Up @@ -90,16 +88,12 @@ public class Sampler extends Application {
<2> Apply CSS class to widgets
<3> Apply BootstrapFX stylesheet to scene

=== Java 9+

BootstrapFX can be used in a modular fashion when running in Java9+. It's module name is `{project-group}.core`.

== Building

You must meet the following requirements:

* JDK8u60 as a minimum
* Gradle 6+
* JDK11 as a minimum
* Gradle 6.3

You may used the included gradle wrapper script if you don't have `gradle` installed.

Expand All @@ -117,7 +111,7 @@ You may used the included gradle wrapper script if you don't have `gradle` insta

. Follow the instructions found at http://sdkman.io/ to install SDKMAN.
. You need a POSIX environment if running Windows. We recommend using Babun Shell (http://babun.github.io/)
. Once SDKMAN is installed invoke `sdk install gradle 5.2`.
. Once SDKMAN is installed invoke `sdk install gradle 6.3`.
. Test your setup by invoking `gradle --version`.

.Gum
Expand All @@ -129,20 +123,16 @@ to use the gradle wrapper if available or your global gradle command. This is an

=== Next Steps

. Make a full build by invoking the following command
Make a full build by invoking the following command
[source]
----
$ gm build
----
. Run the sampler application by invoking the following command

Run the sampler application by invoking the following command
[source]
----
$ gm :sampler:run
----
. Run the sampler application with link:https://www.jpro.one/[JPro] by invoking the following command
[source]
----
$ gm :sampler-jpro:jproRun
----

== Supported CSS Classes
Expand Down Expand Up @@ -232,6 +222,10 @@ image::images/splitmenu-buttons.png[]

== Changelog

.0.3.0

* The build was updated to use a different SASS plugin.

.0.2.4

* The `bootstrapfx.css` file has been moved to `org/kordamp/bootstrapfx/bootstrapfx.css`.
Expand Down
33 changes: 29 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
* THE SOFTWARE.
*/

plugins {
id 'com.google.osdetector'
}

ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os

config {
info {
description = 'BootstrapFX: CSS and widgets'
Expand All @@ -43,21 +49,40 @@ config {

docs {
javadoc {
autoLinks {
enabled = false
}
options {
addBooleanOption('javafx', true)
links('http://docs.oracle.com/javase/8/javafx/api/')
}
aggregate {
enabled = false
}
}
}
}

allprojects {
apply plugin: 'idea'
}

license {
mapping {
fxml = 'XML_STYLE'
idea {
project {
jdkName sourceCompatibility
languageLevel sourceCompatibility

ipr {
withXml { provider ->
def node = provider.asNode()
node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
}
}
}
}

allprojects {
license {
exclude '**/*.fxml'
exclude '**/*.scss'
}
}
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
# THE SOFTWARE.
#

version = 0.3.0
version = 0.4.0-SNAPSHOT
group = org.kordamp.bootstrapfx
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11
javafxVersion = 11

kordampPluginVersion = 0.41.0
kordampBuildVersion = 2.0.0
osPluginVersion = 1.6.2
freefairPluginVersion = 5.3.0
modularityPluginVersion = 1.7.0
java9cPluginVersion = 0.2.3

org.gradle.daemon = true
org.gradle.caching = true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
64 changes: 38 additions & 26 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@
* THE SOFTWARE.
*/

pluginManagement {
repositories {
jcenter()
gradlePluginPortal()
mavenLocal()
}
plugins {
id 'org.javamodularity.moduleplugin' version modularityPluginVersion
id 'io.freefair.jsass-java' version freefairPluginVersion
id 'com.google.osdetector' version osPluginVersion
id 'org.jonnyzzz.java9c' version java9cPluginVersion
}
}

buildscript {
repositories {
gradlePluginPortal()
jcenter()
maven { url 'https://sandec.bintray.com/repo' }
mavenLocal()
}
dependencies {
classpath "com.sandec.jpro:jpro-plugin-gradle:2018.1.9"
classpath "org.kordamp.gradle:kordamp-parentbuild:$kordampBuildVersion"
}
}
Expand All @@ -42,28 +54,28 @@ enforce {
rule(enforcer.rules.EnforceBytecodeVersion) { r ->
r.enabled = false
}
rule(enforcer.rules.ForceDependencies) { r ->
r.dependencies.addAll 'com.typesafe.play:twirl-api_2.12:1.3.15',
'commons-codec:commons-codec:1.10',
'org.apache.commons:commons-lang3:3.6',
'org.scala-lang:scala-library:2.12.6',
'org.scala-lang:scala-reflect:2.12.6',
'org.scala-lang.modules:scala-parser-combinators_2.12:1.1.1',
'com.fasterxml.jackson.core:jackson-core:2.8.11',
'com.fasterxml.jackson.core:jackson-annotations:2.8.11',
'com.fasterxml.jackson.core:jackson-databind:2.8.11.1',
'junit:junit:4.12',
'com.google.code.findbugs:jsr305:3.0.2',
'org.seleniumhq.selenium:selenium-api:3.5.3',
'org.seleniumhq.selenium:selenium-support:3.5.3',
'org.seleniumhq.selenium:selenium-remote-driver:3.5.3',
'com.google.guava:guava:23.0',
'com.typesafe.akka:akka-actor_2.12:2.5.17',
'com.typesafe.akka:akka-stream_2.12:2.5.17',
'com.typesafe:config:1.3.3',
'org.slf4j:slf4j-api:1.7.25',
'org.slf4j:jul-to-slf4j:1.7.25',
'org.bouncycastle:bcprov-jdk15on:1.60',
'org.jruby:jruby-complete:9.2.0.0'
}
// rule(enforcer.rules.ForceDependencies) { r ->
// r.dependencies.addAll 'com.typesafe.play:twirl-api_2.12:1.3.15',
// 'commons-codec:commons-codec:1.10',
// 'org.apache.commons:commons-lang3:3.6',
// 'org.scala-lang:scala-library:2.12.6',
// 'org.scala-lang:scala-reflect:2.12.6',
// 'org.scala-lang.modules:scala-parser-combinators_2.12:1.1.1',
// 'com.fasterxml.jackson.core:jackson-core:2.8.11',
// 'com.fasterxml.jackson.core:jackson-annotations:2.8.11',
// 'com.fasterxml.jackson.core:jackson-databind:2.8.11.1',
// 'junit:junit:4.12',
// 'com.google.code.findbugs:jsr305:3.0.2',
// 'org.seleniumhq.selenium:selenium-api:3.5.3',
// 'org.seleniumhq.selenium:selenium-support:3.5.3',
// 'org.seleniumhq.selenium:selenium-remote-driver:3.5.3',
// 'com.google.guava:guava:23.0',
// 'com.typesafe.akka:akka-actor_2.12:2.5.17',
// 'com.typesafe.akka:akka-stream_2.12:2.5.17',
// 'com.typesafe:config:1.3.3',
// 'org.slf4j:slf4j-api:1.7.25',
// 'org.slf4j:jul-to-slf4j:1.7.25',
// 'org.bouncycastle:bcprov-jdk15on:1.60',
// 'org.jruby:jruby-complete:9.2.0.0'
// }
}
14 changes: 8 additions & 6 deletions subprojects/bootstrapfx-core/bootstrapfx-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

plugins {
id 'java-library'
id 'io.freefair.jsass-java' version '5.3.0'
id 'org.jonnyzzz.java9c'
id 'org.javamodularity.moduleplugin'
id 'io.freefair.jsass-java'
}

config {
Expand All @@ -38,8 +40,8 @@ processResources {
exclude('**/*.scss')
}

jar {
manifest {
attributes('Automatic-Module-Name': 'org.kordamp.bootstrapfx.core')
}
}
dependencies {
compileOnly "org.openjfx:javafx-base:${javafxVersion}:${platform}"
compileOnly "org.openjfx:javafx-graphics:${javafxVersion}:${platform}"
compileOnly "org.openjfx:javafx-controls:${javafxVersion}:${platform}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.kordamp.bootstrapfx;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

/**
* @author Florian Kirmaier
* @author Andres Almiray
*/
public class SamplerJPro extends Application {
@Override
public void start(Stage primaryStage) throws Exception {

StackPane innerPane = new StackPane(new DemoTabPane());
innerPane.setMaxWidth(1000);
innerPane.setMaxHeight(600);
innerPane.setStyle("-fx-background-color: #ddd; -fx-background-radius: 10;");
StackPane outerPane = new StackPane(innerPane);
outerPane.setStyle("-fx-background-image: url('/org/kordamp/bootstrapfx/ambient-background.jpg');" +
"-fx-background-size: cover;");

Scene scene = new Scene(outerPane);
scene.getStylesheets().addAll(
"org/kordamp/bootstrapfx/bootstrapfx.css",
"org/kordamp/bootstrapfx/sampler.css",
"org/kordamp/bootstrapfx/xml-highlighting.css");

primaryStage.setTitle("BootstrapFX Sampler");
primaryStage.setScene(scene);
primaryStage.show();
}
module org.kordamp.bootstrapfx.core {
exports org.kordamp.bootstrapfx;
exports org.kordamp.bootstrapfx.scene.layout;

requires transitive javafx.base;
requires transitive javafx.graphics;
requires javafx.controls;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.kordamp.bootstrapfx;

plugins {
id 'java-library'
id 'application'
id 'com.sandec.jpro'
}

config {
artifacts {
source { enabled = false }
/**
* @author Andres Almiray
*/
public final class Marker {
private Marker() {
// noop
}
publishing { enabled = false }
bintray { enabled = false }
}

application {
mainClass = 'org.kordamp.bootstrapfx.SamplerJPro'
}

dependencies {
api project(':sampler')
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;

/**
* @author Andres Almiray
*/
@DefaultProperty("body")
public class Panel extends BorderPane {
private ObjectProperty<Node> heading;
Expand Down
Binary file not shown.
Loading

0 comments on commit 53c17a7

Please sign in to comment.