Skip to content
Snippets Groups Projects
Commit d7b7f1f0 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

update to Gradle 6

parent 10ddcd1f
No related branches found
No related tags found
1 merge request!450Gradle Update
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
* default Eclipse directories such as WebContent may be deleted. * default Eclipse directories such as WebContent may be deleted.
*/ */
apply plugin: 'jacoco' plugins {
apply plugin: 'war' id 'eclipse-wtp'
apply plugin: 'eclipse-wtp' id 'jacoco'
id 'war'
}
sourceCompatibility = 1.8 sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8' compileJava.options.encoding = 'UTF-8'
...@@ -39,15 +41,15 @@ repositories { ...@@ -39,15 +41,15 @@ repositories {
} }
dependencies { dependencies {
compile 'org.apache.tomcat:tomcat-catalina:8.0.45' implementation 'org.apache.tomcat:tomcat-catalina:8.0.45'
compile 'javax.websocket:javax.websocket-api:1.1' implementation 'javax.websocket:javax.websocket-api:1.1'
compile 'com.amazonaws:aws-lambda-java-core:1.1.0' implementation 'com.amazonaws:aws-lambda-java-core:1.1.0'
compile 'com.amazonaws:aws-java-sdk-lambda:1.11.461' implementation 'com.amazonaws:aws-java-sdk-lambda:1.11.461'
compile 'com.amazonaws:aws-java-sdk-s3:1.11.579' implementation 'com.amazonaws:aws-java-sdk-s3:1.11.579'
compile 'com.amazonaws:aws-java-sdk-ec2:1.11.619' implementation 'com.amazonaws:aws-java-sdk-ec2:1.11.619'
compile project(':nshmp-lib') implementation project(':nshmp-lib')
testCompile 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
} }
sourceSets { sourceSets {
...@@ -75,7 +77,7 @@ ext { ...@@ -75,7 +77,7 @@ ext {
projectName = 'nshmp-haz' projectName = 'nshmp-haz'
propsPath = '/classes/java/main/service.properties' propsPath = '/classes/java/main/service.properties'
/* Multi-model repository paths for version tracking */ /* Multi-model repository paths for version tracking */
repo_cous_2008 = '../nshm-cous-2008' repo_cous_2008 = '../nshm-cous-2008'
repo_cous_2014 = '../nshm-cous-2014' repo_cous_2014 = '../nshm-cous-2014'
...@@ -83,7 +85,7 @@ ext { ...@@ -83,7 +85,7 @@ ext {
repo_cous_2018 = '../nshm-cous-2018' repo_cous_2018 = '../nshm-cous-2018'
repo_hi_2020 = '../nshm-hi-2020' repo_hi_2020 = '../nshm-hi-2020'
repo_ak_2007 = '../nshm-ak-2007' repo_ak_2007 = '../nshm-ak-2007'
/* Explicit model paths */ /* Explicit model paths */
model_wus_2008 = "${repo_cous_2008}/Western US" model_wus_2008 = "${repo_cous_2008}/Western US"
model_ceus_2008 = "${repo_cous_2008}/Central & Eastern US" model_ceus_2008 = "${repo_cous_2008}/Central & Eastern US"
...@@ -109,15 +111,15 @@ ext { ...@@ -109,15 +111,15 @@ ext {
dev_models = [ dev_models = [
[ model_ceus_2018, 'models/ceus/2018' ], [ model_ceus_2018, 'models/ceus/2018' ],
[ model_wus_2018, 'models/wus/2018' ], [ model_wus_2018, 'models/wus/2018' ],
[ model_hi_2020, 'models/hi/2020' ] [ model_hi_2020, 'models/hi/2020' ]
] ]
getGitTag = { gitDir -> getGitTag = { gitDir ->
def cmd = 'git --git-dir=' + gitDir + '/.git describe --tags' def cmd = 'git --git-dir=' + gitDir + '/.git describe --tags'
return cmd.execute().text.replace('\n', '') ?: 'unknown' return cmd.execute().text.replace('\n', '') ?: 'unknown'
} }
/* /*
* The git-dir option gets the correct tag when * The git-dir option gets the correct tag when
* build is called from nshmp-haz-ws. * build is called from nshmp-haz-ws.
*/ */
...@@ -128,7 +130,7 @@ ext { ...@@ -128,7 +130,7 @@ ext {
docTitle = projectName + ': ' + gitLink docTitle = projectName + ': ' + gitLink
docFooter = '<div style="float: left; font-size: 16px; text-align: right; ' + docFooter = '<div style="float: left; font-size: 16px; text-align: right; ' +
'padding: 10px; width: 100%; box-sizing: border-box; background-color: #f9f9f9">' + 'padding: 10px; width: 100%; box-sizing: border-box; background-color: #f9f9f9">' +
'<b><a href="https://www.usgs.gov" target="_top">U.S. Geological Survey</a></b> ' + '<b><a href="https://www.usgs.gov" target="_top">U.S. Geological Survey</a></b> ' +
'– National Seismic Hazard Model Project ' + '– National Seismic Hazard Model Project ' +
'(<a href="https://earthquake.usgs.gov/hazards/" target="_top">NSHMP</a>) ' + '(<a href="https://earthquake.usgs.gov/hazards/" target="_top">NSHMP</a>) ' +
'– <a href="https://github.com/usgs/nshmp-haz/blob/master/LICENSE.md" ' + '– <a href="https://github.com/usgs/nshmp-haz/blob/master/LICENSE.md" ' +
...@@ -149,11 +151,11 @@ jacocoTestReport { ...@@ -149,11 +151,11 @@ jacocoTestReport {
html.enabled true html.enabled true
} }
afterEvaluate { afterEvaluate {
classDirectories = files(classDirectories.files.collect { classDirectories.from(files(classDirectories.files.collect {
fileTree( fileTree(
dir: it, dir: it,
exclude: ['**/etc/**']) exclude: ['**/etc/**'])
}) }))
} }
} }
check.dependsOn jacocoTestReport check.dependsOn jacocoTestReport
...@@ -205,14 +207,14 @@ jar { ...@@ -205,14 +207,14 @@ jar {
doFirst { doFirst {
/* possible fat jar */ /* possible fat jar */
if (rootProject.name == projectName && !thinJar) { if (rootProject.name == projectName && !thinJar) {
from { configurations.compile.collect { from { configurations.compileClasspath.collect {
it.isDirectory() ? it : zipTree(it).matching { it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') } exclude { it.path.contains('META-INF') }
} }
}} }}
} }
/* /*
* Possibly record app version. The creation of this file * Possibly record app version. The creation of this file
* on each build causes the classpath to appear changed so * on each build causes the classpath to appear changed so
* Gradle reruns tests, even though no code has changed. * Gradle reruns tests, even though no code has changed.
...@@ -245,8 +247,8 @@ war { ...@@ -245,8 +247,8 @@ war {
enabled = true enabled = true
webAppDirName = 'webapp' webAppDirName = 'webapp'
dependsOn jar dependsOn jar
/* /*
* Exclude existing models directory with symlinks * Exclude existing models directory with symlinks
* to support Eclipse deployments. * to support Eclipse deployments.
*/ */
...@@ -279,7 +281,7 @@ task assembleDev(type: War, dependsOn: 'war') { ...@@ -279,7 +281,7 @@ task assembleDev(type: War, dependsOn: 'war') {
* Create am exploded war file with production models * Create am exploded war file with production models
*/ */
task assembleUsgs(type: Sync) { task assembleUsgs(type: Sync) {
into "${libsDir}/exploded-war" into "${libsDirectory.get()}/exploded-war"
with war with war
doFirst { doFirst {
...@@ -292,7 +294,7 @@ task assembleUsgs(type: Sync) { ...@@ -292,7 +294,7 @@ task assembleUsgs(type: Sync) {
* Create am exploded war file with development models * Create am exploded war file with development models
*/ */
task assembleUsgsDev(type: Sync) { task assembleUsgsDev(type: Sync) {
into "${libsDir}/exploded-war" into "${libsDirectory.get()}/exploded-war"
with assembleDev with assembleDev
doFirst { doFirst {
...@@ -304,17 +306,17 @@ task assembleUsgsDev(type: Sync) { ...@@ -304,17 +306,17 @@ task assembleUsgsDev(type: Sync) {
/** /**
* Create a zip file of all dependencies * Create a zip file of all dependencies
*/ */
task dependencies(type: Zip) { task libs(type: Zip) {
baseName = "nshmp-haz-dependencies" archiveBaseName = "nshmp-haz-dependencies"
from { from {
configurations.compile.collect { configurations.compileClasspath.collect {
it it
} }
} }
into("java/lib") into("java/lib")
destinationDir libsDir destinationDirectory.value(libsDirectory)
} }
/** /**
......
No preview for this file type
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment