Skip to content

Commit

Permalink
Upgrade deprecated Gradle features to modern equivalents (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbabcoc authored Feb 26, 2022
1 parent f4d490a commit 69bf387
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
26 changes: 12 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'net.researchgate.release' version '2.8.1'
}

apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'signing'
Expand All @@ -29,6 +29,8 @@ if (!project.hasProperty('profile')) {
assert ['selenium2', 'selenium3'].contains(profile)
}

apply from: "${profile}Deps.gradle"

def archiveVer = null
def verBits = project.version.split('-')
def seleniumApi = 's' + profile.charAt(8)
Expand Down Expand Up @@ -100,7 +102,7 @@ clean {

jacoco {
toolVersion = '0.8.5'
reportsDir = file("${buildDir}/customJacocoReportDir")
reportsDirectory = file("${buildDir}/customJacocoReportDir")
}

jacocoTestReport {
Expand Down Expand Up @@ -139,8 +141,8 @@ task("${profile}Jar", type: Jar) {
into(destPath)
filter(ReplaceTokens, tokens: propTokens)
}
archiveName = archiveBase + '.jar'
destinationDir = libsDir
archiveFileName = archiveBase + '.jar'
destinationDirectory = libsDir
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

Expand All @@ -154,8 +156,8 @@ task("${profile}SourcesJar", type: Jar) {

classifier = 'sources'
from sourceSets["${profile}"].allSource
archiveName = archiveBase + '-sources.jar'
destinationDir = libsDir
archiveFileName = archiveBase + '-sources.jar'
destinationDirectory = libsDir
}

task("${profile}JavadocJar", type: Jar, dependsOn: "${profile}Javadoc") {
Expand All @@ -164,8 +166,8 @@ task("${profile}JavadocJar", type: Jar, dependsOn: "${profile}Javadoc") {

classifier = 'javadoc'
from tasks["${profile}Javadoc"].destinationDir
archiveName = archiveBase + '-javadoc.jar'
destinationDir = libsDir
archiveFileName = archiveBase + '-javadoc.jar'
destinationDirectory = libsDir
}

task testNG(type: Test) {
Expand Down Expand Up @@ -293,12 +295,8 @@ dependencies {
compile('com.github.sbabcoc:logback-testng:1.3.4') {
exclude group: 'org.testng', module: 'testng'
}
compile('org.hamcrest:hamcrest-core:2.2') { force = true }
compile('org.yaml:snakeyaml:1.28') { force = true }

apply from: "${profile}Deps.gradle"

testCompile configurations["${profile}Compile"]
compile('org.hamcrest:hamcrest-core') { version { strictly '2.2' } }
compile('org.yaml:snakeyaml') { version { strictly '1.28' } }
}

test {
Expand Down
16 changes: 10 additions & 6 deletions selenium2Deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@ tasks.withType(JavaCompile) {
options.bootstrapClasspath = files("${System.env.JDK7_HOME}/jre/lib/rt.jar")
}

configurations {
selenium2Compile.extendsFrom compile
testCompile.extendsFrom selenium2Compile
}

dependencies {
selenium2Compile configurations.compile
selenium2Compile 'com.nordstrom.tools:testng-foundation:3.0.6-j7'
selenium2Compile 'commons-io:commons-io:2.4'
selenium2Compile('org.seleniumhq.selenium:selenium-server:2.53.1') {
exclude group: 'org.seleniumhq.selenium', module: 'selenium-java'
}
selenium2Compile 'org.seleniumhq.selenium:selenium-support:2.53.1'
selenium2Compile 'org.jsoup:jsoup:1.13.1'
selenium2Compile('org.bouncycastle:bcpkix-jdk15on:1.68') { force = true }
selenium2Compile('org.bouncycastle:bcprov-jdk15on:1.68') { force = true }
selenium2Compile('org.apache.httpcomponents:httpmime:4.5.13') { force = true }
selenium2Compile('org.apache.httpcomponents:httpclient:4.5.13') { force = true }
selenium2Compile('org.eclipse.jetty.websocket:websocket-client:9.2.30.v20200428') { force = true }
selenium2Compile('org.bouncycastle:bcpkix-jdk15on') { version { strictly '1.68' } }
selenium2Compile('org.bouncycastle:bcprov-jdk15on') { version { strictly '1.68' } }
selenium2Compile('org.apache.httpcomponents:httpmime') { version { strictly '4.5.13' } }
selenium2Compile('org.apache.httpcomponents:httpclient') { version { strictly '4.5.13' } }
selenium2Compile('org.eclipse.jetty.websocket:websocket-client') { version { strictly '9.2.30.v20200428' } }
testCompile 'org.seleniumhq.selenium:htmlunit-driver:2.24'
testCompile 'org.mockito:mockito-core:2.25.0'
}
18 changes: 11 additions & 7 deletions selenium3Deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ tasks.withType(JavaCompile) {
options.bootstrapClasspath = files("${System.env.JDK8_HOME}/jre/lib/rt.jar")
}

configurations {
selenium3Compile.extendsFrom compile
testCompile.extendsFrom selenium3Compile
}

dependencies {
selenium3Compile configurations.compile
selenium3Compile 'com.nordstrom.tools:testng-foundation:3.0.6-j8'
selenium3Compile('org.apache.commons:commons-lang3:3.12.0') { force = true }
selenium3Compile('com.google.guava:guava:30.1.1-jre') { force = true }
selenium3Compile('org.apache.commons:commons-lang3') { version { strictly '3.12.0' } }
selenium3Compile('com.google.guava:guava') { version { strictly '30.1.1-jre' } }
selenium3Compile 'org.apache.httpcomponents:httpclient:4.5.13'
selenium3Compile('com.beust:jcommander:1.78') { force = true }
selenium3Compile('com.beust:jcommander') { version { strictly '1.78' } }
selenium3Compile('org.seleniumhq.selenium:selenium-server:3.141.59') {
exclude module: 'selenium-chrome-driver'
exclude module: 'selenium-edge-driver'
Expand All @@ -24,9 +28,9 @@ dependencies {
}
selenium3Compile 'org.seleniumhq.selenium:selenium-support:3.141.59'
selenium3Compile 'org.jsoup:jsoup:1.14.2'
selenium3Compile('com.squareup.okhttp3:okhttp:4.9.1') { force = true }
selenium3Compile('com.squareup.okio:okio:2.10.0') { force = true }
selenium3Compile('org.eclipse.jetty.websocket:websocket-client:9.4.43.v20210629') { force = true }
selenium3Compile('com.squareup.okhttp3:okhttp') { version { strictly '4.9.1' } }
selenium3Compile('com.squareup.okio:okio') { version { strictly '2.10.0' } }
selenium3Compile('org.eclipse.jetty.websocket:websocket-client') { version { strictly '9.4.43.v20210629' } }
testCompile 'org.seleniumhq.selenium:htmlunit-driver:2.53.0'
testCompile 'org.mockito:mockito-core:3.1.0'
}

0 comments on commit 69bf387

Please sign in to comment.