Skip to content

Commit

Permalink
Multiple updates:
Browse files Browse the repository at this point in the history
- Check Java11 compatibility
- Add minimum POM to JAR file
- Dependency updates
  • Loading branch information
aalmiray committed Sep 27, 2018
1 parent 1890ce2 commit 7844dfd
Show file tree
Hide file tree
Showing 79 changed files with 108 additions and 12 deletions.
66 changes: 55 additions & 11 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
= BootstrapFX
:linkattrs:
:project-owner: aalmiray
:project-repo: kordamp
:project-name: bootstrapfx-core
:project-group: org.kordamp.bootstrapfx
:project-owner: aalmiray
:project-repo: kordamp
:project-name: bootstrapfx-core
:project-group: org.kordamp.bootstrapfx
:project-version: 0.2.4

image:http://img.shields.io/travis/aalmiray/bootstrapfx/master.svg["Build Status (travis)", link="https://travis-ci.org/aalmiray/bootstrapfx"]
image:http://img.shields.io/badge/license-MIT-blue.svg["MIT Licensed", link="http://opensource.org/licenses/MIT"]
Expand All @@ -21,7 +22,42 @@ provides new widgets, behavior and a grid system. Some of these features may be

== Installing

You can get the latest version of **BootstrapFX** directly from link:https://bintray.com[Bintray's JCenter] repository.
You can get the latest version of **BootstrapFX** directly from link:https://bintray.com[Bintray's JCenter] repository or Maven Central.

[source,groovy]
[subs="attributes"]
.gradle
----
repositories {
jcenter()
}
dependencies {
compile '{project-group}:bootstrapfx-core:{project-version}'
}
----

[source,xml]
[subs="attributes,verbatim"]
.maven
----
<dependencies>
<dependency>
<groupId>{project-group}</groupId>
<artifactId>bootstrapfx-core</artifactId>
<version>{project-version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
<name>jcenter</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
----

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

Expand All @@ -38,18 +74,18 @@ import org.kordamp.bootstrapfx.scene.layout.Panel;
public class Sampler extends Application {
@Override
public void start(Stage primaryStage) throws Exception { //<1>
public void start(Stage primaryStage) throws Exception { //<1>
Panel panel = new Panel("This is the title");
panel.getStyleClass().add("panel-primary"); //<2>
panel.getStyleClass().add("panel-primary"); //<2>
BorderPane content = new BorderPane();
content.setPadding(new Insets(20));
Button button = new Button("Hello BootstrapFX");
button.getStyleClass().setAll("btn","btn-danger"); //<2>
button.getStyleClass().setAll("btn","btn-danger"); //<2>
content.setCenter(button);
panel.setBody(content);
Scene scene = new Scene(panel);
scene.getStylesheets().add("bootstrapfx.css"); //<3>
scene.getStylesheets().add("org/kordamp/bootstrapfx/bootstrapfx.css"); //<3>
primaryStage.setTitle("BootstrapFX");
primaryStage.setScene(scene);
Expand All @@ -62,12 +98,16 @@ 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 `org.kordamp.bootstrapfx.core`.

== Building

You must meet the following requirements:

* JDK8u60 as a minimum
* Gradle 4.6
* Gradle 4.10

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

Expand All @@ -85,7 +125,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 2.6`.
. Once SDKMAN is installed invoke `sdk install gradle 4.10`.
. Test your setup by invoking `gradle --version`.

.Gdub
Expand Down Expand Up @@ -195,6 +235,10 @@ image::images/splitmenu-buttons.png[]

== Changelog

.0.2.4

* The `bootstrapfx.css` file has been moved to `org/kordamp/bootstrapfx/bootstrapfx.css`.

.0.2.3

* Added `progress-bar` variants
Expand Down
48 changes: 48 additions & 0 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,43 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

task generateMinPom {
doLast {
String pomHeader = """<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>${project.group}</groupId>
<artifactId>${project.name}</artifactId>
<version>${project.version}</version>
""".stripIndent(12)

def dependencyTemplate = { dep -> """
<dependency>
<groupId>$dep.group</groupId>
<artifactId>$dep.name</artifactId>
<version>$dep.version</version>
</dependency>
""".stripIndent(4)
}

String deps = configurations.runtime.allDependencies.findAll({it.name!= 'unspecified'})
.collect({ dep -> dependencyTemplate(dep)}).join('')

String pom = pomHeader
if (deps) {
pom += " <dependencies>\n$deps\n </dependencies>\n"
}
pom += "</project>"

project.file("$buildDir/tmp/maven").mkdirs()
project.file("$buildDir/tmp/maven/pom.xml").text = pom
}
}

jar {
dependsOn 'generateMinPom'
manifest {
attributes(
'Created-By': buildCreatedBy,
Expand All @@ -43,6 +79,18 @@ jar {
from(rootProject.files('.')) {
include 'LICENSE*'
}
from(rootProject.file('src/maven')) {
into "maven/${project.group}/${project.name}"
expand(
'gradle_version': gradle.gradleVersion,
'project_version': project.version,
'project_group': project.group,
'project_name': project.name,
)
}
from(file("$buildDir/tmp/maven")) {
into "maven/${project.group}/${project.name}"
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/maven/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by Gradle $gradle_version
version=$project_version
groupId=$project_group
artifactId=$project_name
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void start(Stage primaryStage) throws Exception {

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

Expand Down

0 comments on commit 7844dfd

Please sign in to comment.