Skip to content

Commit d5cc472

Browse files
authored
Merge pull request #353 from ysb33r/appveyor-cleanup
Making tests work on Appveyor again
2 parents 910a8f8 + f10c395 commit d5cc472

File tree

8 files changed

+41
-15
lines changed

8 files changed

+41
-15
lines changed

base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyPrepareGemsIntegrationSpec.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
2020
setup:
2121
withDependencies "gems ${slimGem}"
2222
withPreamble """
23-
jruby.gemInstallDir = '${projectDir.absolutePath}'
23+
jruby.gemInstallDir = '${pathAsUriStr(projectDir)}'.toURI()
2424
"""
2525

2626
when:
@@ -35,7 +35,7 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
3535
setup:
3636
withDefaultRepositories()
3737
withPreamble """
38-
jruby.gemInstallDir = '${projectDir.absolutePath}'
38+
jruby.gemInstallDir = '${pathAsUriStr(projectDir)}'.toURI()
3939
"""
4040
withDependencies """
4141
gems "rubygems:sinatra:1.4.5"
@@ -57,7 +57,7 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
5757
setup:
5858
withDefaultRepositories()
5959
withPreamble """
60-
jruby.gemInstallDir = '${projectDir.absolutePath}'
60+
jruby.gemInstallDir = '${pathAsUriStr(projectDir)}'.toURI()
6161
"""
6262
withDependencies 'gems "rubygems:jar-dependencies:0.1.16.pre"'
6363

@@ -74,7 +74,7 @@ class JRubyPrepareGemsIntegrationSpec extends IntegrationSpecification {
7474
setup:
7575
withDefaultRepositories()
7676
withPreamble """
77-
jruby.gemInstallDir = '${projectDir.absolutePath}'
77+
jruby.gemInstallDir = '${pathAsUriStr(projectDir)}'.toURI()
7878
"""
7979
withDependencies 'gems "rubygems:childprocess:1.0.1"'
8080

base-plugin/src/integTest/groovy/com/github/jrubygradle/JRubyPrepareJarsIntegrationSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class JRubyPrepareJarsIntegrationSpec extends IntegrationSpecification {
1212
given:
1313
buildFile.text = """
1414
${projectWithLocalRepo}
15-
jruby.gemInstallDir = '${projectDir.absolutePath}'
15+
jruby.gemInstallDir = '${pathAsUriStr(projectDir)}'.toURI()
1616
1717
dependencies {
1818
gems 'io.dropwizard.metrics:metrics-core:3.1.0'

base-plugin/src/integTest/groovy/com/github/jrubygradle/testhelper/IntegrationSpecification.groovy

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,22 @@ class IntegrationSpecification extends Specification {
5454
"'${VersionFinder.findDependency(flatRepoLocation, organisation, artifact, extension)}'"
5555
}
5656

57+
String pathAsUriStr(final File path) {
58+
path.absoluteFile.toURI().toString()
59+
}
60+
5761
String getProjectWithLocalRepo() {
5862
"""
5963
plugins {
6064
id 'com.github.jruby-gradle.base'
6165
}
6266
6367
jruby.defaultRepositories = false
64-
repositories.flatDir dirs: '${flatRepoLocation.absolutePath}'
68+
repositories {
69+
flatDir {
70+
dirs '${pathAsUriStr(flatRepoLocation)}'.toURI()
71+
}
72+
}
6573
"""
6674
}
6775

@@ -72,8 +80,15 @@ class IntegrationSpecification extends Specification {
7280
}
7381
7482
jruby.defaultRepositories = false
75-
repositories.maven { url 'file://${mavenRepoLocation.absolutePath}' }
76-
repositories.flatDir dirs: '${flatRepoLocation.absolutePath}'
83+
84+
repositories {
85+
flatDir {
86+
dirs '${pathAsUriStr(flatRepoLocation)}'.toURI()
87+
}
88+
maven {
89+
url '${pathAsUriStr(mavenRepoLocation)}'.toURI()
90+
}
91+
}
7792
"""
7893
}
7994

@@ -84,7 +99,7 @@ class IntegrationSpecification extends Specification {
8499
}
85100
86101
jruby.defaultRepositories = true
87-
repositories.maven { url 'file://${mavenRepoLocation.absolutePath}' }
102+
repositories.maven { url '${pathAsUriStr(mavenRepoLocation)}'.toURI() }
88103
"""
89104
}
90105

base-plugin/src/main/groovy/com/github/jrubygradle/JRubyPrepare.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import org.gradle.api.file.FileCollection
88
import org.gradle.api.tasks.InputFiles
99
import org.gradle.api.tasks.Internal
1010
import org.gradle.api.tasks.Optional
11-
import org.gradle.api.tasks.OutputDirectory
1211
import org.gradle.api.tasks.TaskAction
1312

1413
/**
@@ -19,9 +18,12 @@ import org.gradle.api.tasks.TaskAction
1918
@CompileStatic
2019
class JRubyPrepare extends DefaultTask {
2120

21+
JRubyPrepare() {
22+
outputs.dir({ JRubyPrepare t -> new File(t.getOutputDir(), 'gems') }.curry(this))
23+
}
24+
2225
/** Target directory for GEMs. Extracted GEMs should end up in {@code outputDir + "/gems"}
2326
*/
24-
@OutputDirectory
2527
File getOutputDir() {
2628
project.file(this.outputDir)
2729
}

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id 'org.ysb33r.gradletest' version '2.0-rc.4' apply false
44
id 'com.jfrog.bintray' version '1.8.4' apply false
55
id 'org.ajoberstar.github-pages' version '1.2.0' apply false
6+
id 'org.ysb33r.cloudci.appveyor.testreporter' version '2.5' apply false
67
}
78

89
buildScan {
@@ -44,6 +45,7 @@ subprojects {
4445
apply plugin: 'com.jfrog.bintray'
4546
apply plugin: 'org.ysb33r.gradletest'
4647
apply plugin: 'maven-publish'
48+
apply plugin: 'org.ysb33r.cloudci.appveyor.testreporter'
4749
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
4850

4951
dependencies {

gradle/codenarc.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ ruleset {
243243
SystemOutPrint
244244
SystemRunFinalizersOnExit
245245
TernaryCouldBeElvis
246-
ThisReferenceEscapesConstructor
247246
ThreadGroup
248247
ThreadLocalNotStaticFinal
249248
ThreadYield

jar-plugin/src/integTest/groovy/com/github/jrubygradle/jar/JRubyJarTestKitSpec.groovy

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,13 @@ class JRubyJarTestKitSpec extends IntegrationSpecification {
169169

170170
private void withLocalRepositories() {
171171
this.repoSetup = """
172-
repositories {
173-
repositories.flatDir dirs: '${flatRepoLocation.absolutePath}'
174-
repositories.maven { url 'file://${mavenRepoLocation.absolutePath}' }
172+
repositories {
173+
flatDir {
174+
dirs '${pathAsUriStr(flatRepoLocation)}'
175+
}
176+
maven {
177+
url '${pathAsUriStr(mavenRepoLocation)}'
178+
}
175179
}
176180
"""
177181
}

jar-plugin/src/integTest/groovy/com/github/jrubygradle/jar/helpers/IntegrationSpecification.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class IntegrationSpecification extends Specification {
4646
.forwardOutput()
4747
}
4848

49+
String pathAsUriStr(final File path) {
50+
path.absoluteFile.toURI().toString()
51+
}
52+
4953
private Map<String, String> loadTestProperties() {
5054
this.class.getResource('/jruby-gradle-testconfig.properties').withInputStream { strm ->
5155
Properties props = new Properties()

0 commit comments

Comments
 (0)