Skip to content

Gradle improvements #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
.DS_Store

.idea/shelf

.idea/tasks.xml

.idea/workspace.xml

build

classes

testClasses

worldwind.jar

worldwindx.jar

/nbproject/private/

gradle
gradlew
gradlew.bat
.gradle
/bin/
.nb-gradle
31 changes: 20 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,35 @@ language: java
jdk:
- openjdk8
- openjdk11
- openjdk12
- oraclejdk8
- oraclejdk11
- openjdk-ea


before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

# Don't fail the build on the early access JDK, or wait for it to finish before marking it done.
matrix:
fast_finish: true
allow_failures:
- jdk: openjdk-ea
- jdk: openjdk-ea

# Install the Ant JUnit package, which is missing from the Travis CI environment. See the Travis documentation: https://docs.travis-ci.com/user/installing-dependencies/#Adding-APT-Packages
addons:
apt:
packages:
- ant-optional
# Install gradle wrapper based on version defined in wrapper.gradle
before_install:
# Use Java 8 to install the wrapper as this command will fail in Java 11.
- JAVA_HOME=`jdk_switcher home openjdk8` gradle -b wrapper.gradle wrapper

# Custom install script to force using ant instead of gradle if travis detects a build.gradle file.
# Clean up project before running build script.
install:
# Using clean as dummy target; could install dependencies here if needed.
- ant clean
- ./gradlew clean

# Use xvfb to run tests that require a GUI and give it some time to start
before_script:
Expand All @@ -38,14 +47,14 @@ before_script:

# Build the project
script:
- ant build
- ./gradlew build javadoc

# Deploy develop branch javadocs to gh_pages, and create and deploy CHANGELOG.md on tags
deploy:
# Publish API documentation to GitHub Pages
- provider: pages
github_token: $GITHUB_API_KEY
local_dir: build/doc/javadoc
local_dir: build/docs/javadoc
skip_cleanup: true
on:
branch: develop
Expand Down
34 changes: 14 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'java'

group = 'gov.nasa'
group = 'earth.worldwind'
version = '2.2.0'

sourceCompatibility = '1.8'
Expand Down Expand Up @@ -33,6 +33,11 @@ sourceSets {
main {
java {
srcDirs = ['src']
include '**/*.java'
}
resources {
srcDirs = ['src']
exclude '**/*.java'
}
}
test {
Expand All @@ -43,7 +48,7 @@ sourceSets {
}

compileJava {
options.debug = project.hasProperty("debugBuild") ? "${project.debugBuild}".toBoolean() : false
options.debug = !project.hasProperty("releaseBuild")
}

// Compile worldwind jar.
Expand All @@ -52,11 +57,6 @@ jar {
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 {
Expand All @@ -70,19 +70,13 @@ jar.doLast {
task extensionsJar(type: Jar) {
group = 'build'
description = 'Assembles a jar archive containing the extension classes.'
archiveBaseName = 'worldwindx'
baseName = '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/**'
from (sourceSets.main.output) {
exclude 'com/**'
exclude 'config/**'
exclude 'images/**'
exclude 'gov/nasa/worldwind/**'
}
}
// Copy worldwindx jar to project-directory.
Expand Down Expand Up @@ -116,4 +110,4 @@ javadoc {
}
exclude 'com/**'
exclude 'gov/nasa/worldwind/formats/**'
}
}
15 changes: 0 additions & 15 deletions nbproject/ide-file-targets.xml

This file was deleted.

15 changes: 0 additions & 15 deletions nbproject/ide-targets.xml

This file was deleted.

7 changes: 0 additions & 7 deletions nbproject/project.properties

This file was deleted.

138 changes: 0 additions & 138 deletions nbproject/project.xml

This file was deleted.

Loading