From df71b212cccdff68c36425d3d9420abc497b722a Mon Sep 17 00:00:00 2001 From: Wiehann Matthysen Date: Wed, 17 Apr 2019 13:00:04 +0200 Subject: [PATCH] Initial gradle build configuration. This commit contains an initial gradle configuration that allows for the worldwind.jar and worldwindx.jar files to be built. The tests are run and the javadoc can also be built. --- .gitignore | 4 +- build.gradle | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 1 + 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 build.gradle create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 0298e34df4..bae75d1291 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,6 @@ worldwind.jar worldwindx.jar -/nbproject/private/ \ No newline at end of file +/nbproject/private/ + +.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..71a39b5b97 --- /dev/null +++ b/build.gradle @@ -0,0 +1,108 @@ +apply plugin: 'java' + +group = 'gov.nasa' +version = '2.2.0' + +sourceCompatibility = '1.8' +targetCompatibility = '1.8' + +repositories { + mavenLocal() + mavenCentral() + jcenter() +} + +dependencies { + def joglVersion = '2.3.2' + implementation "org.jogamp.jogl:jogl-all-main:$joglVersion" + implementation "org.jogamp.gluegen:gluegen-rt-main:$joglVersion" + + implementation files('gdal.jar') + + implementation 'org.codehaus.jackson:jackson-core-asl:1.9.13' + + testImplementation 'junit:junit:4.5' +} + +sourceSets { + main { + java { + srcDirs = ['src'] + } + } + test { + java { + srcDirs = ['test'] + } + } +} + +// Compile worldwind jar. +jar { + dependsOn classes + version = null + from sourceSets.main.output + exclude 'gov/nasa/worldwindx/**' + from(sourceSets.main.allSource) { + include 'gov/nasa/worldwind/util/**/*.properties' + include 'config/**' + include 'images/**' + } +} +// Copy worldwind jar to project-directory. +jar.doLast { + copy { + from "$buildDir/libs/${jar.archiveName}" + into "${project.projectDir}" + } +} + +// Compile worldwindx jar. +task extensionsJar(type: Jar) { + archiveBaseName = 'worldwindx' + version = null + from sourceSets.main.output + include 'gov/nasa/worldwindx/**/*.class' + from(sourceSets.main.allSource) { + include 'gov/nasa/worldwindx/applications/sar/*.html' + include 'gov/nasa/worldwindx/applications/sar/config/**' + include 'gov/nasa/worldwindx/applications/sar/data/**' + include 'gov/nasa/worldwindx/applications/sar/images/**' + include 'gov/nasa/worldwindx/applications/worldwindow/config/**' + include 'gov/nasa/worldwindx/applications/worldwindow/images/**' + include 'gov/nasa/worldwindx/examples/data/**' + include 'gov/nasa/worldwindx/examples/images/**' + } +} +// Copy worldwindx jar to project-directory. +extensionsJar.doLast { + copy { + from "$buildDir/libs/${extensionsJar.archiveName}" + into "${project.projectDir}" + } +} + +artifacts { + archives extensionsJar +} + +test { + dependsOn jar + classpath += project.files("$buildDir/libs/${jar.archiveName}", configurations.runtime) +} + +javadoc { + options { + overview = "${project.projectDir}/src/overview.html" + windowTitle = 'WorldWindJava API' + title = 'NASA WorldWind Java-Community Edition' + header = 'NASA WorldWind-CE' + splitIndex = true + noDeprecated = true + version = false + author = false + use = true + } + exclude 'com/**' + exclude 'gov/nasa/worldwind/formats/**' +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..16f5f2561c --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'worldwind'