Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Upgrade to Gradle 6.9 (#29)
Browse files Browse the repository at this point in the history
Description
===========

This is a general update to Gradle 6.9/7.
To do this we need to update all kinds of plugins to
the latest available version to be compatible.

Changes
=======

* ![UPDATE] ![GRADLE] to version `6.9`
* ![UPDATE] `net.wooga.unity` plugin to version `2.x`
  • Loading branch information
Larusso authored Jun 15, 2021
1 parent 2fd0d8b commit 41f08eb
Show file tree
Hide file tree
Showing 15 changed files with 243 additions and 261 deletions.
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,30 @@ Development
Gradle and Java Compatibility
=============================

Built with Oracle JDK7
Tested with Oracle JDK8
Built with OpenJDK8

| Gradle Version | Works |
| :-------------: | :----: |
| < 3.0 | ![no] |
| 3.0 | ![no] |
| 3.1 | ![no] |
| 3.2 | ![no] |
| 3.3 | ![no] |
| 3.4 | ![no] |
| 3.5 | ![no] |
| 3.5.1 | ![no] |
| 4.0 | ![no] |
| 4.1 | ![no] |
| 4.2 | ![no] |
| 4.3 | ![no] |
| 4.4 | ![no] |
| 4.5 | ![no] |
| 4.6 | ![no] |
| 4.6 | ![no] |
| 4.7 | ![yes] |
| 4.8 | ![yes] |
| 4.9 | ![yes] |
| 4.10 | ![yes] |
| < 5.1 | ![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] |
| 6.9 | ![yes] |
| 7.0 | ![yes] |

LICENSE
=======
Expand Down
24 changes: 16 additions & 8 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.4.0'
id 'net.wooga.plugins' version '2.1.1'
}

group 'net.wooga.gradle'
Expand All @@ -41,15 +41,23 @@ github {
}

repositories {
jcenter()
maven { url "https://dl.bintray.com/wooga/maven" }
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}

dependencies {
compile "net.wooga:unity-version-manager-jni:1.+"
compile "gradle.plugin.net.wooga.gradle:atlas-unity:1.+"
testCompile 'net.wooga.test:unity-project-generator-rule:0.2.0'
testCompile 'com.github.stefanbirkner:system-rules:1.18.0'
testCompile "com.wooga.spock.extensions:spock-unity-version-manager-extension:0.1.0"
implementation "net.wooga:unity-version-manager-jni:(1,2]"
implementation "gradle.plugin.net.wooga.gradle:atlas-unity:(2,3]"
testImplementation 'net.wooga.test:unity-project-generator-rule:0.3.0'
testImplementation "com.wooga.spock.extensions:spock-unity-version-manager-extension:0.2.0"
}

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.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
32 changes: 29 additions & 3 deletions gradle_check_versions.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
#!/usr/bin/env bash

versions=("4.0" "4.1" "4.2" "4.3" "4.4" "4.5" "4.6" "4.7" "4.8" "4.9" "4.10")
#
# 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.1" "5.2" "5.3" "5.4" "5.5" "5.6" "6.0" "6.1" "6.2" "6.3" "6.4" "6.5" "6.6" "6.7" "6.8")

rm -fr build/reports
for i in "${versions[@]}"
do
echo "test gradle version $i"
GRADLE_VERSION=$i ./gradlew test &> /dev/null
status=$?
mkdir -p "build/reports/$i"
mv build/reports/test "build/reports/$i"
if [ $status -ne 0 ]; then
echo "test error $i"
fi

GRADLE_VERSION=$i ./gradlew integrationTest &> /dev/null
status=$?
mkdir -p "build/reports/$i"
mv build/reports/integrationTest "build/reports/$i"
if [ $status -ne 0 ]; then
echo "test error $i"
echo "integrationTest error $i"
fi
done
done
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class IntegrationSpec extends nebula.test.IntegrationSpec {
ProvideSystemProperty properties = new ProvideSystemProperty("ignoreDeprecations", "true")

@Shared
@UnityInstallation(version="2018.4.19f1", basePath = "build/unity", cleanup = true)
@UnityInstallation(version = "2018.4.2f1", basePath = "build/unity", cleanup = false)
Installation preInstalledUnity2018_4_19f1

@Shared
@UnityInstallation(version="2018.4.18f1", basePath = "build/unity", cleanup = true)
@UnityInstallation(version = "2018.4.1f1", basePath = "build/unity", cleanup = false)
Installation preInstalledUnity2018_4_18f1

def setup() {
Expand All @@ -49,12 +49,12 @@ class IntegrationSpec extends nebula.test.IntegrationSpec {
fork = true
}

environmentVariables.clear(
UnityVersionManagerConsts.UNITY_VERSION_ENV_VAR,
UnityVersionManagerConsts.UNITY_INSTALL_BASE_DIR_PATH_ENV_VAR,
UnityVersionManagerConsts.AUTO_INSTALL_UNITY_EDITOR_PATH_ENV_VAR,
UnityVersionManagerConsts.AUTO_SWITCH_UNITY_EDITOR_PATH_ENV_VAR
)
(UnityVersionManagerConventions.unityVersion.environmentKeys +
UnityVersionManagerConventions.unityInstallBaseDir.environmentKeys +
UnityVersionManagerConventions.autoInstallUnityEditor.environmentKeys +
UnityVersionManagerConventions.autoSwitchUnityEditor.environmentKeys).each {
environmentVariables.clear(it)
}
}

static String escapedPath(String path) {
Expand Down Expand Up @@ -123,7 +123,7 @@ class IntegrationSpec extends nebula.test.IntegrationSpec {
static String testPath(String path) {
if (isWindows()) {
if (path.startsWith("/")) {
path = "C:" + path
path = "C:" + path
}

path = path.replace('/', '\\')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class UnityVersionManagerExtensionIntegrationSpec extends IntegrationSpec {
unityVersion = "${defaultProjectVersion}"
}
def componentsProvider = uvm.buildRequiredUnityComponentsProvider
def componentsProvider = uvm.buildRequiredUnityComponents
task(customUnityIos, type: ${Unity.name}) {
buildTarget = 'ios'
Expand All @@ -177,7 +177,7 @@ class UnityVersionManagerExtensionIntegrationSpec extends IntegrationSpec {
buildTarget = 'webGl'
}
[customUnityIos, customUnityAndroid, customUnityWebGl].each {it.deleteAllActions()}
[customUnityIos, customUnityAndroid, customUnityWebGl].each {it.actions = []}
task(printComponents) {
println("print during task configuration: " + componentsProvider.get().sort())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.junit.Rule
import spock.lang.IgnoreIf
import spock.lang.Unroll
import wooga.gradle.unity.UnityPlugin
import wooga.gradle.unity.batchMode.BuildTarget
import wooga.gradle.unity.models.BuildTarget
import wooga.gradle.unity.tasks.Unity

class UvmCheckInstalltionIntegrationSpec extends IntegrationSpec {
Expand Down Expand Up @@ -169,7 +169,7 @@ class UvmCheckInstalltionIntegrationSpec extends IntegrationSpec {

expect:
def result = runTasksWithFailure("customUnity")
result.standardOutput.contains("Unable to install requested unity version ${editorVersion}")
result.standardError.contains("Unable to install requested unity version ${editorVersion}")

where:
editorVersion = "2030.1.0f1"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2017 the original author or authors.
*
* 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.unity.version.manager

import wooga.gradle.unity.utils.PropertyLookup

class UnityVersionManagerConventions {

/**
* Gradle property/env convention to set the default value for {@code autoSwitchUnityEditor}.
* @see UnityVersionManagerExtension#getAutoSwitchUnityEditor()
*/
static final PropertyLookup autoSwitchUnityEditor = new PropertyLookup("UVM_AUTO_SWITCH_UNITY_EDITOR", "uvm.autoSwitchUnityEditor", false)

/**
* Gradle property/env convention set the default value for {@code autoInstallUnityEditor}.
* @see UnityVersionManagerExtension#getAutoInstallUnityEditor()
*/
static final PropertyLookup autoInstallUnityEditor = new PropertyLookup("UVM_AUTO_INSTALL_UNITY_EDITOR", "uvm.autoInstallUnityEditor", false)

/**
* Gradle property/env convention to set the default value for {@code unityInstallBaseDir}.
* @see UnityVersionManagerExtension#getUnityInstallBaseDir()
*/
static final PropertyLookup unityInstallBaseDir = new PropertyLookup("UVM_UNITY_INSTALL_BASE_DIR", "uvm.unityInstallBaseDir", null)

/**
* Gradle property/env convention to set the default value for {@code unityVersion}.
* @see UnityVersionManagerExtension#getUnityVersion()
*/
static final PropertyLookup unityVersion = new PropertyLookup("UVM_UNITY_VERSION", "uvm.unityVersion", null)
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import net.wooga.uvm.Component
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.provider.SetProperty

interface UnityVersionManagerExtension {

Expand Down Expand Up @@ -77,5 +78,5 @@ interface UnityVersionManagerExtension {
* @param project the gradle project
* @return A provider object which resolves the required build components needed for the current build.
*/
Provider<Set<Component>> getBuildRequiredUnityComponentsProvider()
SetProperty<Component> getBuildRequiredUnityComponents()
}
Loading

0 comments on commit 41f08eb

Please sign in to comment.