Skip to content

Commit

Permalink
Updated build scripts for latest gradle version. Moved some build scr…
Browse files Browse the repository at this point in the history
…ipt properties into gradle.properties. Cleaned up some javadoc warnings.
  • Loading branch information
deanriverson committed Jun 3, 2012
1 parent fd6d97f commit a29ce43
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 69 deletions.
66 changes: 25 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,37 @@ apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'idea'

/***************************************
* Set Maven coordinates and build vars
***************************************/
group = 'org.jfxtras'
archivesBaseName = "jfxtras-labs"
version = '0.1-SNAPSHOT'

isRelease = !version.endsWith('SNAPSHOT')
requiredJavaFxVersion = '2.1.0'

//sourceCompatibility = 7

/***************************************
* Check environment
***************************************/
javafxHome = System.env['JAVAFX_HOME']
if(!javafxHome) {
println """Please set environment variable JAVAFX_HOME
to the directory that contains /rt/lib/jfxrt.jar
for JavaFX version $requiredJavaFxVersion"""
System.exit 1
}

buildscript {
dependencies {
classpath files("${System.env['JAVAFX_HOME']}/rt/lib/jfxrt.jar")
final javafxHome = System.env['JAVAFX_HOME']
if (javafxHome) {
ext.javafxJar = "${javafxHome}/rt/lib/jfxrt.jar"
} else {
final javaHome = System.env['JAVA_HOME']
if (javaHome)
ext.javafxJar = "${javaHome}/jre/lib/jfxrt.jar"
}

try {
println "JavaFX runtime jar: ${ext.javafxJar}"
dependencies {
classpath files(ext.javafxJar)
}
} catch (MissingPropertyException mpe) {
println """
| Please set the environment variable JAVAFX_HOME
| to the directory that contains rt/lib/jfxrt.jar
| of JavaFX version ${jfxtras_requiredJavaFxVersion}.\n""".stripMargin()
System.exit 1
}
}
/*
actualJavaFXVersion = com.sun.javafx.runtime.VersionInfo.runtimeVersion
if (!actualJavaFXVersion.startsWith(requiredJavaFxVersion)) {
println "Required JavaFX version is '$requiredJavaFxVersion' but actual version is '$actualJavaFXVersion'"
System.exit(1)
}
*/
// environment is ok

/***************************************
* The build script proper
***************************************/
repositories {
mavenCentral()
}

dependencies {
compile files("${javafxHome}/rt/lib/jfxrt.jar")
testCompile 'junit:junit:4.10'
compile files(ext.javafxJar)
testCompile "junit:junit:${jfxtras_junitVersion}"
testCompile files("lib/jemmy.jar", "lib/JemmyAWT.jar", "lib/JemmyAWTInput.jar", "lib/JemmyBrowser.jar", "lib/JemmyCore.jar", "lib/JemmyFX.jar")
}

Expand All @@ -68,15 +52,15 @@ task buildTimestamped(type: Copy, dependsOn: 'build') {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-8'
gradleVersion = '1.0-rc-3'
}

signArchives.onlyIf {
hasProperty('signing.keyId')
project.hasProperty('signing.keyId')
}

uploadArchives.onlyIf {
hasProperty('sonatypeUsername') && hasProperty('sonatypePassword')
project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
}

task copyToLib(type: Copy) {
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
group = org.jfxtras
archivesBaseName = jfxtras-labs
version = 0.1-SNAPSHOT
jfxtras_requiredJavaFxVersion = 2.1
jfxtras_junitVersion = 4.10
6 changes: 4 additions & 2 deletions gradle/mavenCentralDeploy.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// ------------- Maven Central deployment ---------------

task docJar(type: Jar, dependsOn: javadoc) {
Expand All @@ -21,10 +22,12 @@ signing {
}

uploadArchives {
if (!hasProperty('sonatypeUsername') || !hasProperty('sonatypePassword'))
if (!project.hasProperty('sonatypeUsername') || !project.hasProperty('sonatypePassword'))
return

repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
Expand All @@ -33,7 +36,6 @@ uploadArchives {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

//repository(url: "file:///Users/dean/temp/m2")
pom.project {
name 'JFXtras Labs'
url 'http://jfxtras.org'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Feb 14 15:59:36 MST 2012
#Sun Jun 03 10:11:31 MDT 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-8-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-3-bin.zip
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
JAVA_OPTS="$JAVA_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/jfxtras/labs/scene/control/BigDecimalField.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ public BigDecimalField(BigDecimal initialValue, BigDecimal stepwidth, NumberForm
}

/**
* @return text representation of number
* @return The text representation of number
*/
public String getText() {
return getFormat().format(number.getValue());
}

/**
*
* @param text representation of number
* @param formattedNumber representation of number
*/
public void setText(String formattedNumber) {
try {
Expand Down Expand Up @@ -98,24 +98,21 @@ public void decrement() {
final private ObjectProperty<BigDecimal> number;

/**
* The BigDecimal number
* @return
* @return The BigDecimal number
*/
public BigDecimal getNumber() {
return number.getValue();
}

/**
* The BigDecimal number
* @return
* Set the BigDecimal number
*/
public void setNumber(BigDecimal value) {
public void setNumber(BigDecimal value) {
number.set(value);
}

/**
* The BigDecimal number
* @return
* @return The property containing the BigDecimal number
*/
public ObjectProperty<BigDecimal> numberProperty() {
return number;
Expand Down
20 changes: 9 additions & 11 deletions src/main/java/jfxtras/labs/scene/control/Spinner.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public Spinner()
// model

/**
* @param model
* @param startValue
* @param items The item list used to populate the spinner.
*/
public Spinner(ObservableList<T> items)
{
Expand All @@ -87,8 +86,8 @@ public Spinner(ObservableList<T> items)
}

/**
* @param model
* @param startValue
* @param items The item list used to populate the spinner.
* @param startValue The initial value of the spinner (one of the items).
*/
public Spinner(ObservableList<T> items, T startValue)
{
Expand All @@ -101,7 +100,6 @@ public Spinner(ObservableList<T> items, T startValue)
// convenience

/**
*
* @param list
*/
public Spinner(java.util.List<T> list)
Expand All @@ -110,7 +108,6 @@ public Spinner(java.util.List<T> list)
}

/**
*
* @param list
*/
public Spinner(T... list)
Expand All @@ -119,17 +116,18 @@ public Spinner(T... list)
}

/**
*
* @param list
* @param from
* @param to
*/
public Spinner(int from, int to)
{
this( (java.util.List<T>) new SpinnerIntegerList(from, to) );
}

/**
*
* @param list
* @param from
* @param to
* @param step
*/
public Spinner(int from, int to, int step)
{
Expand Down Expand Up @@ -531,7 +529,7 @@ public void last()
* Does a o1.equals(o2) but also checks if o1 or o2 are null.
* @param o1
* @param o2
* @return
* @return True if the two values are equal, false otherwise.
*/
static public boolean equals(Object o1, Object o2)
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jfxtras/labs/util/NodeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class NodeUtil
/**
*
* @param node
* @return
* @return The X screen coordinate of the node.
*/
static public double screenX(Node node)
{
Expand All @@ -17,7 +17,7 @@ static public double screenX(Node node)
/**
*
* @param node
* @return
* @return The Y screen coordinate of the node.
*/
static public double screenY(Node node)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class StringConverterFactory
{
/**
*
* @return
* @return A default string converter that does no extra processing on the strings it is given.
*/
static public StringConverter<String> forString()
{
Expand Down

0 comments on commit a29ce43

Please sign in to comment.