diff --git a/.travis.yml b/.travis.yml index cebef65..e4a3a49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ before_install: install: - echo "skip default gradlew assemble" script: -- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew release cobertura -Dorg.ajoberstar.grgit.auth.username=${GH_TOKEN} -Dorg.ajoberstar.grgit.auth.password -Dgradle.publish.key=${GRADLE_KEY} -Dgradle.publish.secret=${GRADLE_SECRET} --info --stacktrace || ./gradlew build cobertura --info --stacktrace' +- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew release -Dorg.ajoberstar.grgit.auth.username=${GH_TOKEN} -Dorg.ajoberstar.grgit.auth.password -Dgradle.publish.key=${GRADLE_KEY} -Dgradle.publish.secret=${GRADLE_SECRET} --info --stacktrace || ./gradlew build --info --stacktrace' after_success: - - ./gradlew coveralls + - ./gradlew jacocoTestReport coveralls diff --git a/src/test/groovy/de/gliderpilot/gradle/semanticrelease/SemanticReleaseChangeLogServiceSpec.groovy b/src/test/groovy/de/gliderpilot/gradle/semanticrelease/SemanticReleaseChangeLogServiceSpec.groovy index 1bb5b14..75b036f 100644 --- a/src/test/groovy/de/gliderpilot/gradle/semanticrelease/SemanticReleaseChangeLogServiceSpec.groovy +++ b/src/test/groovy/de/gliderpilot/gradle/semanticrelease/SemanticReleaseChangeLogServiceSpec.groovy @@ -181,6 +181,7 @@ class SemanticReleaseChangeLogServiceSpec extends Specification { given: grgit = Grgit.open() changeLogService = new SemanticReleaseChangeLogService(grgit, tagStrategy) + String mnemo = changeLogService.mnemo() when: def commits = [ @@ -191,21 +192,21 @@ class SemanticReleaseChangeLogServiceSpec extends Specification { 'feat: baz\n\nCloses #159\n\nBREAKING CHANGE: This and that', 'foo bar'] def expected = """\ - # [2.0.0](https://github.com/tschulte/gradle-semantic-release-plugin/compare/v1.0.0...v2.0.0) (${ + # [2.0.0](https://github.com/$mnemo/compare/v1.0.0...v2.0.0) (${ new java.sql.Date(System.currentTimeMillis()) }) ### Bug Fixes - * no component ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #456, #789) + * no component ([1234567](https://github.com/$mnemo/commit/1234567), closes #456, #789) * **component1:** - * foo ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #123, #124) - * bar ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567)) - * **component2:** baz ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #123, #124) + * foo ([1234567](https://github.com/$mnemo/commit/1234567), closes #123, #124) + * bar ([1234567](https://github.com/$mnemo/commit/1234567)) + * **component2:** baz ([1234567](https://github.com/$mnemo/commit/1234567), closes #123, #124) ### Features - * baz ([1234567](https://github.com/tschulte/gradle-semantic-release-plugin/commit/1234567), closes #159) + * baz ([1234567](https://github.com/$mnemo/commit/1234567), closes #159) ### BREAKING CHANGES @@ -221,9 +222,12 @@ class SemanticReleaseChangeLogServiceSpec extends Specification { given: grgit = Grgit.open() changeLogService = new SemanticReleaseChangeLogService(grgit, tagStrategy) - changeLogService.github = new MkGithub("tschulte") - changeLogService.github.repos().create(Json.createObjectBuilder().add("name", "gradle-semantic-release-plugin").build()) - def coordinates = new Coordinates.Simple("tschulte/gradle-semantic-release-plugin") + String mnemo = changeLogService.mnemo() + String user = mnemo.substring(0, mnemo.indexOf("/")) + String repo = mnemo.substring(mnemo.indexOf("/") + 1) + changeLogService.github = new MkGithub(user) + changeLogService.github.repos().create(Json.createObjectBuilder().add("name", repo).build()) + def coordinates = new Coordinates.Simple("$mnemo") changeLogService.github.repos().get(coordinates).git().references().create("refs/tags/v1.0.0", "affe") changeLogService.changeLog = { List commits, ReleaseVersion version -> "${'changelog'}" diff --git a/src/test/groovy/de/gliderpilot/gradle/semanticrelease/integration/SemanticReleasePluginIntegrationSpec.groovy b/src/test/groovy/de/gliderpilot/gradle/semanticrelease/integration/SemanticReleasePluginIntegrationSpec.groovy index bf09e9a..df5a0c7 100644 --- a/src/test/groovy/de/gliderpilot/gradle/semanticrelease/integration/SemanticReleasePluginIntegrationSpec.groovy +++ b/src/test/groovy/de/gliderpilot/gradle/semanticrelease/integration/SemanticReleasePluginIntegrationSpec.groovy @@ -19,6 +19,9 @@ import nebula.test.IntegrationSpec import spock.lang.Requires import spock.lang.Unroll +import java.lang.management.ManagementFactory +import java.lang.management.RuntimeMXBean + /** * Created by tobias on 7/2/15. */ @@ -28,6 +31,7 @@ import spock.lang.Unroll class SemanticReleasePluginIntegrationSpec extends IntegrationSpec { def setup() { + setupJvmArguments() setupGit() // create the gradle wrapper before the project is setup setupGradleWrapper() @@ -37,6 +41,13 @@ class SemanticReleasePluginIntegrationSpec extends IntegrationSpec { push() } + def setupJvmArguments() { + RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean() + String buildDir = new File('build').canonicalPath + jvmArguments = runtimeMxBean.getInputArguments().collect { it.replaceAll(/([:=])build/, '$1' + buildDir) } + file('gradle.properties') << "org.gradle.jvmargs=${jvmArguments.join(' ')}" + } + /** * Gradle-git seems to have issues when run using the nebula integration spec. * This results in the integration spec to publish to the real repo -- even creating tags there. @@ -298,7 +309,7 @@ class SemanticReleasePluginIntegrationSpec extends IntegrationSpec { } def exitValue = process.waitFor() if (exitValue != 0) - throw new RuntimeException("failed to execute ${command.join(' ')}") + throw new RuntimeException("failed to execute ${args.join(' ')}") return lastLine }