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'