Skip to content

Commit

Permalink
Upgrade to Gradle 6.8.3 (#13)
Browse files Browse the repository at this point in the history
* updated to net.wooga.plugins 2.0.0/gradle 6.8.3

Co-authored-by: Joaquim Neto <[email protected]>
  • Loading branch information
Larusso and Joaquimmnetto authored May 5, 2021
1 parent 80c23df commit a28d690
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 84 deletions.
36 changes: 22 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,28 @@ Documentation
Gradle and Java Compatibility
=============================

| Gradle Version | Works |
| :------------- | :---------: |
| < 4.0 | ![no] |
| 4.0 | ![yes] |
| 4.1 | ![yes] |
| 4.2 | ![yes] |
| 4.3 | ![yes] |
| 4.4 | ![yes] |
| 4.5 | ![yes] |
| 4.6 | ![yes] |
| 4.7 | ![yes] |
| 4.8 | ![yes] |
| 4.9 | ![yes] |
| 4.10 | ![yes] |
| Gradle Version | Works |
| :-------------: | :----: |
| < 5.0 | ![no] |
| 5.0 | ![no] |
| 5.1 | ![yes] |
| 5.2 | ![yes] |
| 5.3 | ![yes] |
| 5.4 | ![yes] |
| 5.5 | ![yes] |
| 5.6 | ![yes] |
| 5.6 | ![yes] |
| 6.0 | ![yes] |
| 6.1 | ![yes] |
| 6.2 | ![yes] |
| 6.3 | ![yes] |
| 6.4 | ![yes] |
| 6.5 | ![yes] |
| 6.6 | ![yes] |
| 6.6 | ![yes] |
| 6.7 | ![yes] |
| 6.8 | ![yes] |
| 7.0 | ![yes] |

Development
===========
Expand Down
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

plugins {
id 'net.wooga.plugins' version '1.5.0'
id 'net.wooga.plugins' version '2.0.0'
}

group 'net.wooga.gradle'
Expand All @@ -39,15 +39,19 @@ pluginBundle {
github {
repositoryName = "wooga/atlas-github-release-notes"
}

dependencies {
testCompile('org.spockframework:spock-core:1.2-groovy-2.4') {
exclude module: 'groovy-all'
}

testCompile 'com.github.stefanbirkner:system-rules:1.18.0'
testCompile "org.ajoberstar:gradle-git:1.7.2"
testCompile 'com.wooga.spock.extensions:spock-github-extension:0.1.0'
testCompile "org.ajoberstar:grgit:1.7.2"
testCompile'com.wooga.spock.extensions:spock-github-extension:0.1.2'
compile 'com.wooga.github:github-changelog-lib:0.4.+'
compile "gradle.plugin.net.wooga.gradle:atlas-github:1.+"
compile "gradle.plugin.net.wooga.gradle:atlas-github:2.+"
}
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:2.5.12'
force 'org.codehaus.groovy:groovy-macro:2.5.12'
force 'org.codehaus.groovy:groovy-nio:2.5.12'
force 'org.codehaus.groovy:groovy-sql:2.5.12'
force 'org.codehaus.groovy:groovy-xml:2.5.12'
}
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
18 changes: 16 additions & 2 deletions gradle_check_versions.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#!/usr/bin/env bash
#
# Copyright 2018-2021 Wooga GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

versions=("4.0" "4.1" "4.2" "4.3" "4.4" "4.5" "4.6" "4.7" "4.8" "4.9" "4.10")

versions=("5.0" "5.1" "5.2" "5.3" "5.4" "5.5" "5.6.4" "6.0" "6.1" "6.2" "6.3" "6.4" "6.5" "6.6" "6.7")
for i in "${versions[@]}"
do
echo "test gradle version $i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class RepoLayoutPresets {
static void parallelDevelopmentOnTwoBranchesWithPullRequests(Repository repo) {
/*
NR
30 * Merge branch 'develop' (HEAD -> master, tag: v0.2.0, origin/master)
30 * Merge branch 'develop' (HEAD -> main, tag: v0.2.0, origin/main)
|\
29 | * commit 3 on develop (tag: v0.2.0-rc.2, origin/develop, develop)
28 | * commit 2 on develop
27 | * commit 1 on develop
26 | * Merge branch 'master' into develop
26 | * Merge branch 'main' into develop
| |\
| |/
|/|
Expand Down Expand Up @@ -61,15 +61,15 @@ class RepoLayoutPresets {
Credentials credentials = new Credentials(repo.userName, repo.token)
Grgit git = Grgit.clone(dir: localPath.path, uri: repo.httpTransportUrl, credentials: credentials) as Grgit

git.checkout(branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.commit(message: "commit 2")
git.commit(message: "commit 3")
git.commit(message: "commit 4")
git.commit(message: "commit 5")
git.push(remote: "origin", all: true)
repo.createRelease("0.1.0", "v0.1.0")

git.branch.add(name: 'fix/one', startPoint: 'master')
git.branch.add(name: 'fix/one', startPoint: repo.defaultBranch.name)
git.checkout(branch: "fix/one")

git.commit(message: "commit 1 on fix/one")
Expand All @@ -79,31 +79,31 @@ class RepoLayoutPresets {
git.commit(message: "commit 5 on fix/one")
git.push(remote: "origin", all: true)

def fixOnePr = repo.createPullRequest("A Fix PR 1", "fix/one", "master","")
def fixOnePr = repo.createPullRequest("A Fix PR 1", "fix/one", repo.defaultBranch.name,"")
fixOnePr.setLabels("fix","one")
repo.mergePullRequest(fixOnePr)

git.checkout(branch: "master")
git.pull(rebase:true, branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.pull(rebase:true, branch: repo.defaultBranch.name)

git.branch.add(name: 'develop', startPoint: 'master')
git.branch.add(name: 'develop', startPoint: repo.defaultBranch.name)
git.branch.add(name: 'feature/one', startPoint: 'develop')

git.checkout(branch: "feature/one")
git.commit(message: "commit 1 on feature/one")
git.checkout(branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.commit(message: "commit 6")
git.checkout(branch: "feature/one")
git.commit(message: "commit 2 on feature/one")
git.checkout(branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.commit(message: "commit 7")
git.checkout(branch: "feature/one")
git.commit(message: "commit 3 on feature/one")
git.checkout(branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.commit(message: "commit 8")
git.checkout(branch: "feature/one")
git.commit(message: "commit 4 on feature/one")
git.checkout(branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.commit(message: "commit 9")
git.checkout(branch: "feature/one")
git.commit(message: "commit 5 on feature/one")
Expand All @@ -117,29 +117,29 @@ class RepoLayoutPresets {
git.pull(rebase:true, branch: "develop")
repo.createRelease("0.2.0-rc.1", "v0.2.0-rc.1", "develop")

git.checkout(branch: "master")
git.pull(rebase:true, branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.pull(rebase:true, branch: repo.defaultBranch.name)

git.branch.add(name: 'fix/two', startPoint: 'master')
git.branch.add(name: 'fix/two', startPoint: repo.defaultBranch.name)
git.checkout(branch: "fix/two")

git.commit(message: "commit 1 on fix/two")
git.commit(message: "commit 2 on fix/two")
git.commit(message: "commit 3 on fix/two")
git.push(remote: "origin", all: true)

def fixTwoPr = repo.createPullRequest("A Fix PR 2", "fix/two", "master","")
def fixTwoPr = repo.createPullRequest("A Fix PR 2", "fix/two", repo.defaultBranch.name,"")
fixTwoPr.setLabels("fix","two")
repo.mergePullRequest(fixTwoPr)

git.checkout(branch: "master")
git.pull(rebase:true, branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.pull(rebase:true, branch: repo.defaultBranch.name)

repo.createRelease("0.1.1", "v0.1.1")

git.checkout(branch: "develop")
git.pull(rebase:true, branch: "develop")
git.merge(head: "master", mode: MergeOp.Mode.CREATE_COMMIT)
git.merge(head: repo.defaultBranch.name, mode: MergeOp.Mode.CREATE_COMMIT)

git.commit(message: "commit 1 on develop")
git.commit(message: "commit 2 on develop")
Expand All @@ -148,13 +148,13 @@ class RepoLayoutPresets {
git.push(remote: "origin", all: true)
repo.createRelease("0.2.0-rc.2", "v0.2.0-rc.2", "develop")

git.checkout(branch: "master")
git.pull(rebase:true, branch: "master")
git.checkout(branch: repo.defaultBranch.name)
git.pull(rebase:true, branch: repo.defaultBranch.name)
git.merge(head: "develop", mode: MergeOp.Mode.CREATE_COMMIT)
git.push(remote: "origin", all: true)

repo.createRelease("0.2.0", "v0.2.0")
git.pull(rebase:true, branch: "master")
git.pull(rebase:true, branch: repo.defaultBranch.name)
println("")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
package wooga.gradle.githubReleaseNotes

import com.wooga.github.changelog.DefaultGeneratorStrategy
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.logging.Logging
import org.slf4j.Logger
import wooga.gradle.github.base.GithubBasePlugin
import wooga.gradle.githubReleaseNotes.tasks.GenerateReleaseNotes

Expand All @@ -31,23 +28,17 @@ class GithubReleaseNotesPlugin implements Plugin<Project> {
static final String EXTENSION_NAME = "GithubReleaseNotes"
static final String GENERATE_RELEASE_NOTES_TASK = "generateReleaseNotes"

static Logger logger = Logging.getLogger(GithubReleaseNotesPlugin)

@Override
void apply(Project project) {
project.pluginManager.apply(GithubBasePlugin)
createDefaultTasks(project)

project.tasks.withType(GenerateReleaseNotes, new Action<GenerateReleaseNotes>() {
@Override
void execute(GenerateReleaseNotes task) {
def defaultStrategy = new DefaultGeneratorStrategy()
task.strategy.set(defaultStrategy)
task.releaseName.set(project.provider({project.version.toString()}))
task.output.set(new File(project.buildDir,"outputs/release-notes.txt"))
//task.output.set(project.layout.buildDirectory.dir("outputs").map({ it.file("release-notes.txt") }))
}
})
project.tasks.withType(GenerateReleaseNotes) { GenerateReleaseNotes task ->
def defaultStrategy = new DefaultGeneratorStrategy()
task.strategy.convention(defaultStrategy)
task.releaseName.convention(project.provider({project.version.toString()}))
task.output.convention(project.layout.buildDirectory.file("outputs/release-notes.txt"))
}
}

protected static createDefaultTasks(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GenerateReleaseNotes extends AbstractGithubTask {

GenerateReleaseNotes() {
super(GenerateReleaseNotes.class)
output = this.project.layout.fileProperty()
output = this.project.objects.fileProperty()
from = this.project.objects.property(String)
to = this.project.objects.property(String)
releaseName = this.project.objects.property(String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,4 @@ class GithubReleaseNotesPluginSpec extends ProjectSpec {
"generateReleaseNotes" | GenerateReleaseNotes
}


// @Unroll
// def 'Creates the [#extensionName] extension with type #extensionType'() {
// given:
// assert !project.plugins.hasPlugin(PLUGIN_NAME)
// assert !project.extensions.findByName(extensionName)
//
// when:
// project.plugins.apply(PLUGIN_NAME)
//
// then:
// def extension = project.extensions.findByName(extensionName)
// extensionType.isInstance extension
//
// where:
// extensionName | extensionType
// 'GithubReleaseNotes' | GithubReleaseNotesPluginExtension
// }

}

0 comments on commit a28d690

Please sign in to comment.