Skip to content

Commit

Permalink
Merge branch 'pr-791'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Engelman committed Feb 25, 2023
2 parents 572f6ff + 2a84e87 commit 7831182
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
20 changes: 10 additions & 10 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ dependencies {
shadow gradleApi()
shadow 'org.codehaus.groovy:groovy-backports-compat23:3.0.8'

implementation 'org.jdom:jdom2:2.0.6'
implementation 'org.jdom:jdom2:2.0.6.1'
implementation 'org.ow2.asm:asm:9.4'
implementation 'org.ow2.asm:asm-commons:9.4'
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.apache.ant:ant:1.10.11'
implementation 'org.codehaus.plexus:plexus-utils:3.4.1'
implementation "org.apache.logging.log4j:log4j-core:2.17.1"
implementation('org.vafer:jdependency:2.7.0') {
implementation 'org.apache.ant:ant:1.10.12'
implementation 'org.codehaus.plexus:plexus-utils:3.4.2'
implementation "org.apache.logging.log4j:log4j-core:2.18.0"
implementation('org.vafer:jdependency:2.8.0') {
exclude group: 'org.ow2.asm'
}

testImplementation('org.spockframework:spock-core:2.0-groovy-3.0') {
testImplementation('org.spockframework:spock-core:2.1-groovy-3.0') {
exclude group: 'org.codehaus.groovy'
}
testImplementation 'org.spockframework:spock-junit4:2.0-groovy-3.0'
testImplementation 'org.spockframework:spock-junit4:2.1-groovy-3.0'
testImplementation 'xmlunit:xmlunit:1.6'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'com.google.guava:guava:31.0.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.8.1'
testImplementation 'com.google.guava:guava:31.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.0'
}
2 changes: 1 addition & 1 deletion gradle/docs.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api'
def javaApiUrl = 'http://docs.oracle.com/javase/17/docs/api'
def groovyApiUrl = "http://docs.groovy-lang.org/2.4.7/html/gapi/"

tasks.withType(Javadoc) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,26 @@ abstract class AbstractModule {

private TestFile hashFile(TestFile file, String algorithm, int len) {
def hashFile = getHashFile(file, algorithm)
def hash = getHash(file, algorithm)
hashFile.text = String.format("%0${len}x", hash)
hashFile.text = getHash(file, algorithm)
return hashFile
}

private TestFile getHashFile(TestFile file, String algorithm) {
file.parentFile.file("${file.name}.${algorithm}")
}

protected BigInteger getHash(TestFile file, String algorithm) {
HashUtil.createHash(file, algorithm.toUpperCase()).asBigInteger()
protected String getHash(TestFile file, String algorithm) {
file.newInputStream().withCloseable {
switch (algorithm) {
case 'sha1':
DigestUtils.sha1Hex(it)
break
case 'md5' :
DigestUtils.md5Hex(it)
break
default:
throw new IOException("Unsupported algorithm " + algorithm)
}
}
}
}

0 comments on commit 7831182

Please sign in to comment.