1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
| ext.java9Args = [ "--add-exports=javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls", "--add-exports=javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls", "--add-exports=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls", "--add-exports=javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls", "--add-exports=javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls", "--add-exports=javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls", "--add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls", "--add-exports=javafx.base/com.sun.javafx.collections=org.controlsfx.controls", "--add-exports=javafx.base/com.sun.javafx.runtime=org.controlsfx.controls", "--add-exports=javafx.web/com.sun.webkit=org.controlsfx.controls", "--add-exports=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls" ]
ext.java9RuntimeArgs = [ "--add-opens=javafx.controls/javafx.scene.control.skin=org.controlsfx.controls", "--add-opens=javafx.graphics/javafx.scene=org.controlsfx.controls" ]
static String getOSName() { final String osName = System.getProperty("os.name").toLowerCase() if (osName.contains("linux")) { return ("linux") } else if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) { return ("mac") } else if (osName.contains("windows")) { return ("win") } return ("") }
ext.javafx_modules = [ 'javafx-base', 'javafx-graphics', 'javafx-controls', 'javafx-fxml', 'javafx-media', 'javafx-web' ]
if (JavaVersion.current().isJava11Compatible()) { ext.javafx_version = '11' ext.platform = getOSName() }
subprojects {
apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'osgi' apply plugin: 'maven' apply from : '../mavenPublish.gradle'
Properties cfg = new Properties() cfg.load(new FileInputStream("$rootDir/controlsfx-build.properties"))
ext { artifact_suffix = cfg.artifact_suffix specification_title = cfg.controlsfx_specification_title specification_version = cfg.controlsfx_specification_version controlsfx_name = 'controlsfx' fxsampler_name = 'fxsampler' fxsampler_version = cfg.fxsampler_specification_version + artifact_suffix fxsampler_mainClass = 'org.controlsfx.fxsampler/fxsampler.FXSampler' }
group = 'org.controlsfx' version = specification_version + artifact_suffix
sourceCompatibility = '1.9' targetCompatibility = '1.9'
if (JavaVersion.current().isJava11Compatible()) { sourceCompatibility = rootProject.javafx_version targetCompatibility = rootProject.javafx_version }
afterEvaluate {
repositories { mavenCentral() }
dependencies { testCompile 'junit:junit:[4,)' }
test { testLogging { events 'started', 'passed' } inputs.property("moduleName", moduleName) doFirst { jvmArgs = [ '--module-path', classpath.asPath, '--add-modules', 'ALL-MODULE-PATH', '--add-reads', "$moduleName=junit", '--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath, ] classpath = files() } }
compileJava { inputs.property("moduleName", moduleName) doFirst { options.compilerArgs += [ '--module-path', classpath.asPath, ] classpath = files() } options.encoding = "UTF-8" options.incremental = true if ( project.name != "fxsampler" ) { options.compilerArgs += java9Args } }
javadoc { inputs.property("moduleName", moduleName) doFirst { exclude '**/module-info.java' exclude 'impl/*' options.addStringOption('-module-path', classpath.asPath) options.addStringOption('-class-path', "") options.addBooleanOption('html5', true) options.addBooleanOption('javafx', true) options.addBooleanOption('Xdoclint:none', true) options.encoding = 'UTF-8' javafx_modules.stream() .map { module -> module.replace("-", ".") } .each { options.addStringOption('-add-modules', it) }
options.links("https://docs.oracle.com/javase/9/docs/api") options.addMultilineStringsOption("-add-exports").setValue( [ 'javafx.base/com.sun.javafx.event=ALL-UNNAMED', 'javafx.web/com.sun.webkit=ALL-UNNAMED', 'javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED' ] ) } } }
task sourceJar(type: Jar) { from sourceSets.main.java from sourceSets.main.resources classifier = 'sources' }
task javadocJar(type: Jar) { dependsOn javadoc from javadoc.destinationDir classifier = 'javadoc' }
artifacts { archives sourceJar archives javadocJar }
application { applicationDefaultJvmArgs = [ '--add-opens=javafx.base/com.sun.javafx.runtime=ALL-UNNAMED', '--add-opens=javafx.base/com.sun.javafx.collections=ALL-UNNAMED', '--add-opens=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED', '--add-opens=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED', '--add-opens=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED', '--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED', '--add-opens=javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED', '--add-opens=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED', '--add-opens=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED' ] } }
|