Skip to content

Commit

Permalink
gradle-8.1-rc-2
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Mar 30, 2023
1 parent c3ebfc2 commit 7d23178
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-rc-2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ package com.netflix.gradle.plugins.daemon
import com.netflix.gradle.plugins.packaging.SystemPackagingBasePlugin
import com.netflix.gradle.plugins.packaging.SystemPackagingTask
import com.netflix.gradle.plugins.rpm.Rpm
import com.netflix.gradle.plugins.utils.WrapUtil
import groovy.text.GStringTemplateEngine
import groovy.transform.CompileDynamic
import org.gradle.api.DomainObjectCollection
import org.gradle.api.DomainObjectSet
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.util.WrapUtil

class OspackageDaemonPlugin implements Plugin<Project> {
public static final String POST_INSTALL_TEMPLATE = "postInstall"
Expand Down
104 changes: 104 additions & 0 deletions src/main/groovy/com/netflix/gradle/plugins/utils/WrapUtil.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
package com.netflix.gradle.plugins.utils

import org.gradle.api.DomainObjectSet
import org.gradle.api.internal.CollectionCallbackActionDecorator
import org.gradle.api.internal.DefaultDomainObjectSet

/**
* copied from org.gradle.util.WrapUtil
* <a href="https://github.com/gradle/gradle/blob/v8.0.2/subprojects/core/src/main/java/org/gradle/util/WrapUtil.java">WrapUtil.java</a>
*/
class WrapUtil {
/**
* Wraps the given items in a mutable unordered set.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> Set<T> toSet(T... items) {
Set<T> coll = new HashSet<T>()
Collections.addAll(coll, items)
return coll
}

/**
* Wraps the given items in a mutable domain object set.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> DomainObjectSet<T> toDomainObjectSet(Class<T> type, T... items) {
DefaultDomainObjectSet<T> set = new DefaultDomainObjectSet<T>(type, CollectionCallbackActionDecorator.NOOP)
set.addAll(Arrays.asList(items))
return set
}

/**
* Wraps the given items in a mutable ordered set.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> Set<T> toLinkedSet(T... items) {
Set<T> coll = new LinkedHashSet<T>()
Collections.addAll(coll, items)
return coll
}

/**
* Wraps the given items in a mutable sorted set.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> SortedSet<T> toSortedSet(T... items) {
SortedSet<T> coll = new TreeSet<T>()
Collections.addAll(coll, items)
return coll
}

/**
* Wraps the given items in a mutable sorted set using the given comparator.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> SortedSet<T> toSortedSet(Comparator<T> comp, T... items) {
SortedSet<T> coll = new TreeSet<T>(comp)
Collections.addAll(coll, items)
return coll
}

/**
* Wraps the given items in a mutable list.
*/
@SafeVarargs
@SuppressWarnings("varargs")
static <T> List<T> toList(T... items) {
ArrayList<T> coll = new ArrayList<T>()
Collections.addAll(coll, items)
return coll
}

/**
* Wraps the given items in a mutable list.
*/
static <T> List<T> toList(Iterable<? extends T> items) {
ArrayList<T> coll = new ArrayList<T>()
for (T item : items) {
coll.add(item)
}
return coll
}

/**
* Wraps the given key and value in a mutable unordered map.
*/
static <K, V> Map<K, V> toMap(K key, V value) {
Map<K, V> map = new HashMap<K, V>()
map.put(key, value)
return map
}

@SafeVarargs
@SuppressWarnings("varargs")
static <T> T[] toArray(T... items) {
return items
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class OspackageApplicationSpringBootPluginLauncherSpec extends IntegrationSpec {

where:
bootVersion | moduleSuffix
'2.6.0' | '-plain'
'2.7.0' | '-plain'
}

Expand All @@ -139,7 +138,7 @@ class OspackageApplicationSpringBootPluginLauncherSpec extends IntegrationSpec {
result.standardOutput.contains('Hello Integration Test')

where:
bootVersion << ['2.6.0', '2.7.0']
bootVersion << ['2.7.0']
}

@Unroll
Expand All @@ -163,7 +162,7 @@ class OspackageApplicationSpringBootPluginLauncherSpec extends IntegrationSpec {
result.standardOutput.contains('Hello Integration Test')

where:
bootVersion << ['2.6.0', '2.7.0']
bootVersion << ['2.7.0']
}

@Unroll
Expand Down Expand Up @@ -197,7 +196,6 @@ class OspackageApplicationSpringBootPluginLauncherSpec extends IntegrationSpec {

where:
bootVersion | moduleSuffix
'2.6.0' | '-plain'
'2.7.0' | '-plain'
}

Expand All @@ -219,7 +217,7 @@ class OspackageApplicationSpringBootPluginLauncherSpec extends IntegrationSpec {
result.standardError.contains("mainClass should be configured in order to generate a valid start script. i.e. mainClass.set('com.netflix.app.MyApp')")

where:
bootVersion << ['2.6.0', '2.7.0']
bootVersion << ['2.7.0']
}

@IgnoreIf({ jvm.isJava17() })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.netflix.gradle.plugins.daemon

import nebula.test.ProjectSpec
import org.gradle.util.WrapUtil
import com.netflix.gradle.plugins.utils.WrapUtil

class DaemonExtensionSpec extends ProjectSpec {

Expand Down

0 comments on commit 7d23178

Please sign in to comment.