-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump minimum supported gradle version from 5.0 to 6.0 (via #100)
- Loading branch information
Showing
31 changed files
with
212 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
...in/src/main/kotlin/io/qameta/allure/gradle/adapter/autoconfigure/TrimMetaInfServices53.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 3 additions & 41 deletions
44
allure-base-plugin/src/main/kotlin/io/qameta/allure/gradle/base/backport/GradleExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,19 @@ | ||
package io.qameta.allure.gradle.util | ||
|
||
import org.gradle.api.DomainObjectSet | ||
import org.gradle.api.attributes.AttributeContainer | ||
import org.gradle.api.attributes.Category | ||
import org.gradle.api.attributes.LibraryElements | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.provider.ListProperty | ||
import org.gradle.api.provider.MapProperty | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.provider.Provider | ||
import org.gradle.kotlin.dsl.named | ||
import org.gradle.util.GradleVersion | ||
import org.gradle.util.WrapUtil | ||
|
||
val gradleGe51 = GradleVersion.current() >= GradleVersion.version("5.1") | ||
val gradleGe53 = GradleVersion.current() >= GradleVersion.version("5.3") | ||
val gradleGe55 = GradleVersion.current() >= GradleVersion.version("5.5") | ||
val gradleGe56 = GradleVersion.current() >= GradleVersion.version("5.6") | ||
val gradleGe65 = GradleVersion.current() >= GradleVersion.version("6.5") | ||
|
||
fun <T> Property<T>.conv(v: T) = if (gradleGe51) convention(v) else apply { set(v) } | ||
fun <T> Property<T>.conv(v: Provider<out T>) = if (gradleGe51) convention(v) else apply { set(v) } | ||
|
||
fun <T> ListProperty<T>.conv(v: Iterable<T>) = if (gradleGe51) convention(v) else apply { set(v) } | ||
fun <T> ListProperty<T>.conv(v: Provider<out Iterable<T>>) = if (gradleGe51) convention(v) else apply { set(v) } | ||
|
||
fun <K, V> MapProperty<K, V>.conv(v: Map<K, V>) = if (gradleGe51) convention(v) else apply { set(v) } | ||
fun <K, V> MapProperty<K, V>.conv(v: Provider<out Map<K, V>>) = if (gradleGe51) convention(v) else apply { set(v) } | ||
|
||
fun <T> Property<T>.forUseAtConfigurationTimeBackport(): Property<T> = apply { | ||
if (gradleGe65) { | ||
// forUseAtConfigurationTime is Gradle 6.5+ feature | ||
forUseAtConfigurationTime() | ||
} | ||
} | ||
|
||
inline fun <reified T> ObjectFactory.domainObjectSetBackport(): DomainObjectSet<T> = | ||
if (gradleGe55) domainObjectSet(T::class.java) else WrapUtil.toDomainObjectSet(T::class.java) | ||
|
||
fun AttributeContainer.categoryLibrary(objects: ObjectFactory) { | ||
if (gradleGe53) { | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) | ||
} | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) | ||
} | ||
|
||
fun AttributeContainer.categoryDocumentation(objects: ObjectFactory) { | ||
if (gradleGe53) { | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) | ||
} | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION)) | ||
} | ||
|
||
fun AttributeContainer.libraryElementsJar(objects: ObjectFactory) { | ||
if (gradleGe56) { | ||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) | ||
} | ||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) | ||
} |
Oops, something went wrong.