Skip to content

Commit

Permalink
Upgrades gradle project to use Gradle 6.8.3 (#38)
Browse files Browse the repository at this point in the history
## Description

Upgrades gradle project to use Gradle 6.8.3; updates various properties to use the provider API, deprecating some overloads.

## Changes
* ![UPDATE] AppCenterPlugin
* ![UPDATE] AppCenterUploadTask
* ![UPDATE] AppCenterPluginExtension.
  • Loading branch information
Azurelol authored Apr 20, 2021
1 parent 5f7cfcc commit f1a8d4f
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 200 deletions.
58 changes: 26 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This plugin is work in progress.
**build.gradle**
```groovy
plugins {
id 'net.wooga.appcenter' version '0.7.0'
id 'net.wooga.appcenter' version '1.0.0'
}
```

Expand Down Expand Up @@ -56,40 +56,36 @@ Gradle and Java Compatibility
Built with Oracle JDK7
Tested with Oracle JDK8

| Gradle Version | Works |
| :-------------: | :-------: |
| 4.0 | `v0.6.0` |
| 4.1 | `v0.6.0` |
| 4.2 | `v0.6.0` |
| 4.3 | `v0.6.0` |
| 4.4 | ![yes]_*_ |
| 4.5 | ![yes]_*_ |
| 4.6 | ![yes]_*_ |
| 4.6 | ![yes]_*_ |
| 4.7 | ![yes]_*_ |
| 4.8 | ![yes]_*_ |
| 4.9 | ![yes]_*_ |
| 4.10.2 | ![yes] |
| 5.0 | ![yes] |
| 5.1 | ![yes] |
| 5.2 | ![yes] |
| 5.3 | ![yes] |
| 5.4 | ![yes] |
| 5.5 | ![yes] |
| 5.6.4 | ![yes] |
| 6.0 | ![yes] |
| 6.1 | ![yes] |
| 6.2 | ![yes] |
| 6.3 | ![yes] |
| 6.4 | ![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] |

> (*) Setting multiple distribution groups via the extionsion `defaultDestination` or in the publish task `destination` is not supported.
> Either use the setter `setDefaultDestination`/`setDestination` or invoke `defaultDestination`/`destination` multiple times with a single group
LICENSE
=======

Copyright 2017 Wooga GmbH
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.
Expand All @@ -104,12 +100,10 @@ See the License for the specific language governing permissions and
limitations under the License.

<!-- Links -->
[unity]: https://unity3d.com/ "Unity 3D"
[unity_cmd]: https://docs.unity3d.com/Manual/CommandLineArguments.html
[gradle]: https://gradle.org/ "Gradle"
[gradle_finalizedBy]: https://docs.gradle.org/3.5/dsl/org.gradle.api.Task.html#org.gradle.api.Task:finalizedBy
[gradle_dependsOn]: https://docs.gradle.org/3.5/dsl/org.gradle.api.Task.html#org.gradle.api.Task:dependsOn

[yes]: https://atlas-resources.wooga.com/icons/icon_check.svg "yes"
[no]: https://atlas-resources.wooga.com/icons/icon_uncheck.svg "no"
[yes]: https://resources.atlas.wooga.com/icons/icon_check.svg "yes"
[no]: https://resources.atlas.wooga.com/icons/icon_uncheck.svg "no"

11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

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

group 'net.wooga.gradle'
Expand All @@ -40,11 +40,6 @@ github {
}

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

testCompile 'com.github.stefanbirkner:system-rules:1.18.0'
compile 'org.apache.httpcomponents:httpclient:4.5.13'
compile 'org.apache.httpcomponents:httpmime:4.5.13'
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.apache.httpcomponents:httpmime:4.5.13'
}
18 changes: 17 additions & 1 deletion gradle_check_versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
#!/usr/bin/env bash

versions=("4.4" "4.5" "4.6" "4.7" "4.8" "4.9" "4.10" "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")
#
# 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=("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")

rm -fr build/reports
for i in "${versions[@]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class AppCenterPluginIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary = file("$testFile")
""".stripIndent()

when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IntegrationSpec extends nebula.test.IntegrationSpec {
ProvideSystemProperty properties = new ProvideSystemProperty("ignoreDeprecations", "true")

@Rule
public final EnvironmentVariables environmentVariables = new EnvironmentVariables()
public EnvironmentVariables environmentVariables = new EnvironmentVariables()

def escapedPath(String path) {
String osName = System.getProperty("os.name").toLowerCase()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
testFile = createBigUploadBinary(testFile, File.createTempDir("testUpload", "fileType"), 1024 * 1024 * desiredFileSize)

buildFile << """
publishAppCenter.binary = "${escapedPath(testFile.path)}"
publishAppCenter.applicationIdentifier = "$applicationIdentifier"
publishAppCenter.binary.set(file("${escapedPath(testFile.path)}"))
publishAppCenter.applicationIdentifier.set("$applicationIdentifier")
""".stripIndent()

expect:
Expand All @@ -104,8 +104,8 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
given: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource(fileName).path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.applicationIdentifier = "$applicationIdentifier"
publishAppCenter.binary.set(file("$testFile"))
publishAppCenter.applicationIdentifier.set("$applicationIdentifier")
""".stripIndent()

expect:
Expand All @@ -121,7 +121,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
given: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand All @@ -139,7 +139,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
given: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -169,7 +169,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -199,7 +199,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -244,7 +244,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -277,7 +277,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -315,7 +315,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down Expand Up @@ -375,45 +375,35 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {

where:
property | method | rawValue | type
"apiToken" | "apiToken" | "testToken1" | "String"
"apiToken" | "apiToken.set" | "testToken2" | "String"
"apiToken" | "apiToken.set" | "testToken3" | "Provider<String>"
"apiToken" | "setApiToken" | "testToken4" | "String"
"apiToken" | "setApiToken" | "testToken5" | "Provider<String>"
"owner" | "owner" | "owner1" | "String"
"owner" | "owner.set" | "owner2" | "String"
"owner" | "owner.set" | "owner3" | "Provider<String>"
"owner" | "setOwner" | "owner4" | "String"
"owner" | "setOwner" | "owner5" | "Provider<String>"
"buildVersion" | "buildVersion" | "buildVersion1" | "String"
"buildVersion" | "buildVersion.set" | "buildVersion2" | "String"
"buildVersion" | "buildVersion.set" | "buildVersion3" | "Provider<String>"
"buildVersion" | "setBuildVersion" | "buildVersion4" | "String"
"buildVersion" | "setBuildVersion" | "buildVersion5" | "Provider<String>"
"applicationIdentifier" | "applicationIdentifier" | "applicationIdentifier1" | "String"
"applicationIdentifier" | "applicationIdentifier.set" | "applicationIdentifier2" | "String"
"applicationIdentifier" | "applicationIdentifier.set" | "applicationIdentifier3" | "Provider<String>"
"applicationIdentifier" | "setApplicationIdentifier" | "applicationIdentifier4" | "String"
"applicationIdentifier" | "setApplicationIdentifier" | "applicationIdentifier5" | "Provider<String>"
"releaseNotes" | "releaseNotes" | "releaseNotes1" | "String"
"releaseNotes" | "releaseNotes.set" | "releaseNotes2" | "String"
"releaseNotes" | "releaseNotes.set" | "releaseNotes3" | "Provider<String>"
"releaseNotes" | "setReleaseNotes" | "releaseNotes4" | "String"
"releaseNotes" | "setReleaseNotes" | "releaseNotes5" | "Provider<String>"
"binary" | "binary" | "#projectDir#/some/binary/1" | "String"
"binary" | "binary" | "#projectDir#/some/binary/2" | "File"
"binary" | "binary.set" | "#projectDir#/some/binary/3" | "File"
"binary" | "binary.set" | "#projectDir#/some/binary/4" | "Provider<RegularFile>"
"binary" | "setBinary" | "#projectDir#/some/binary/5" | "String"
"binary" | "setBinary" | "#projectDir#/some/binary/6" | "File"
"binary" | "setBinary" | "#projectDir#/some/binary/7" | "Provider<RegularFile>"

"retryCount" | "retryCount" | 1 | "Integer"
"retryCount" | "retryCount.set" | 2 | "Integer"
"retryCount" | "retryCount.set" | 3 | "Provider<Integer>"
"retryCount" | "setRetryCount" | 4 | "Integer"

"retryTimeout" | "retryTimeout" | 1000L | "Long"
"retryTimeout" | "retryTimeout.set" | 2000L | "Long"
"retryTimeout" | "retryTimeout.set" | 3000L | "Provider<Long>"
"retryTimeout" | "setRetryTimeout" | 4000L | "Long"
Expand All @@ -430,7 +420,7 @@ class AppCenterUploadTaskIntegrationSpec extends IntegrationSpec {
and: "a dummy ipa binary to upload"
def testFile = getClass().getClassLoader().getResource("test.ipa").path
buildFile << """
publishAppCenter.binary = "$testFile"
publishAppCenter.binary.set(file("$testFile"))
""".stripIndent()

and: "a future version meta file"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Wooga GmbH
* Copyright 2019-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.
Expand Down
16 changes: 8 additions & 8 deletions src/main/groovy/wooga/gradle/appcenter/AppCenterPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2018 the original author or authors.
* 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
* 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,
Expand Down Expand Up @@ -45,13 +45,13 @@ class AppCenterPlugin implements Plugin<Project> {
tasks.withType(AppCenterUploadTask, new Action<AppCenterUploadTask>() {
@Override
void execute(AppCenterUploadTask t) {
t.buildVersion.set(project.providers.provider({ project.version.toString() }))
t.buildVersion.convention(project.providers.provider({ project.version.toString() }))
t.destinations.set(extension.defaultDestinations)
t.applicationIdentifier.set(extension.applicationIdentifier)
t.apiToken.set(extension.apiToken)
t.owner.set(extension.owner)
t.retryCount.set(extension.retryCount)
t.retryTimeout.set(extension.retryTimeout)
t.applicationIdentifier.convention(extension.applicationIdentifier)
t.apiToken.convention(extension.apiToken)
t.owner.convention(extension.owner)
t.retryCount.convention(extension.retryCount)
t.retryTimeout.convention(extension.retryTimeout)
}})

project.afterEvaluate(new Action<Project>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Wooga GmbH
* Copyright 2019-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.
Expand All @@ -24,15 +24,12 @@ import org.gradle.api.provider.Property
interface AppCenterPluginExtension {
Property<String> getApiToken()
void setApiToken(String value)
void apiToken(String value)

Property<String> getOwner()
void setOwner(String value)
void owner(String value)
Property<String> getApplicationIdentifier()

void setApplicationIdentifier(String value)
void applicationIdentifier(String value)

ListProperty<Map<String, String>> getDefaultDestinations()

Expand All @@ -49,10 +46,8 @@ interface AppCenterPluginExtension {

Property<Long> getRetryTimeout()
void setRetryTimeout(Long value)
void retryTimeout(Long value)

Property<Integer> getRetryCount()
void setRetryCount(Integer value)
void retryCount(Integer value)

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Wooga GmbH
* Copyright 2019-201 Wooga GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

package wooga.gradle.appcenter.api

import groovy.json.JsonOutput
Expand Down
Loading

0 comments on commit f1a8d4f

Please sign in to comment.