Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Update net.wooga.atlas-paket to 0.8.0 (#23)
Browse files Browse the repository at this point in the history
Description
===========

Update the internal used plugin `net.wooga.atlas-paket` to `0.8.1`.
This new version changed the way it determines the default version value
for a `PaketPack` task. If not set directly it will first check for a
version value in the `paket.template` file and then, if this value is
empty, will use the project version. We want to enforce the use of the project
version for our builds so we set the version property of all tasks with
type `PaketPack` to current project version. This ensures that we don't
generate wrong package versions even if a `paket.template`
contains a `version` argument.

Changes
=======

![Update] `net.wooga.atlas-paket` to `0.8.1`
![Change] set version property on all tasks with type `PaketPack`
  • Loading branch information
Larusso authored Nov 10, 2017
1 parent 236fb43 commit 5809fc6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dependencies {
compile 'com.netflix.nebula:nebula-release-plugin:5.+'
compile 'org.ajoberstar:gradle-git:1.7.+'
compile 'cz.malohlava:visteg:1.0.+'
compile 'gradle.plugin.net.wooga.gradle:atlas-paket:0.7.0'
compile 'gradle.plugin.net.wooga.gradle:atlas-paket:0.8.1'
compile 'gradle.plugin.net.wooga.gradle:atlas-github:0.6.0'

compile gradleApi()
Expand Down
9 changes: 8 additions & 1 deletion src/main/groovy/wooga/gradle/release/ReleasePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,16 @@ class ReleasePlugin implements Plugin<Project> {
def buildTask = tasks.getByName(LifecycleBasePlugin.BUILD_TASK_NAME)
buildTask.dependsOn setup

tasks.withType(PaketPack, new org.gradle.api.Action<PaketPack>() {
tasks.withType(PaketPack, new Action<PaketPack>() {
@Override
void execute(PaketPack paketPack) {
/**
* Sets project version to all <code>PaketPack</code> tasks.
* Version 0.8.0 changed the default behavior for picking the package version.
* This is just a security measure.
*
* */
paketPack.version = { project.version }
paketPack.dependsOn setup
}
})
Expand Down
15 changes: 15 additions & 0 deletions src/test/groovy/wooga/gradle/release/ReleasePluginSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,21 @@ class ReleasePluginSpec extends ProjectSpec {
artifacts.every { it.extension == "nupkg" }
}

def "sets version on paketPack tasks"() {
given: "multiple paket.template files with version set"
createMockPaketTemplate("Wooga.Test1", new File(projectDir, "sub1")) << "version 2.0.0"
createMockPaketTemplate("Wooga.Test2", new File(projectDir, "sub2")) << "version 2.0.0"
createMockPaketTemplate("Wooga.Test3", new File(projectDir, "sub3")) << "version 2.0.0"

when:
project.plugins.apply(PLUGIN_NAME)
project.evaluate()

then:
def tasks = project.tasks.withType(PaketPack)
tasks.every { it.version != "2.0.0"}
}

@Unroll
def "verify githubPublish onlyIf spec when project.status:#testState and github repository #repositoryName"() {
given: "gradle project with plugin applied and evaluated"
Expand Down

0 comments on commit 5809fc6

Please sign in to comment.