Skip to content

Commit

Permalink
Merge pull request #53 from IntershopCommunicationsAG/update_gradle_a…
Browse files Browse the repository at this point in the history
…nd_add_customization_handling

Update gradle and add customization handling
  • Loading branch information
m-raab authored Sep 30, 2022
2 parents e1211d3 + 00e2435 commit 584e731
Show file tree
Hide file tree
Showing 51 changed files with 1,055 additions and 1,392 deletions.
155 changes: 78 additions & 77 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ plugins {
// project plugins
`java-gradle-plugin`
groovy
kotlin("jvm") version "1.6.21"

kotlin("jvm") version "1.7.10"

// test coverage
jacoco
Expand All @@ -44,13 +45,13 @@ plugins {
id("org.asciidoctor.jvm.convert") version "3.3.2"

// documentation
id("org.jetbrains.dokka") version "1.4.32"
id("org.jetbrains.dokka") version "1.5.0"

// code analysis for kotlin
id("io.gitlab.arturbosch.detekt") version "1.17.1"
id("io.gitlab.arturbosch.detekt") version "1.18.0"

// plugin for publishing to Gradle Portal
id("com.gradle.plugin-publish") version "0.15.0"
id("com.gradle.plugin-publish") version "1.0.0"
}

scm {
Expand All @@ -64,11 +65,63 @@ version = scm.version.version
val sonatypeUsername: String by project
val sonatypePassword: String? by project

repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}

gradlePlugin {
plugins {
create("icmDockerPlugin") {
id = "com.intershop.gradle.icm.docker"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerPlugin"
displayName = "icm-docker-plugin"
description = "This ICM plugin contains Docker ICM integration."
}
create("icmDockerTestProjectPlugin") {
id = "com.intershop.gradle.icm.docker.test"
implementationClass = "com.intershop.gradle.icm.docker.ICMTestDockerPlugin"
displayName = "icm-docker-test-plugin"
description = "This ICM plugin contains special Docker tasks for special test container."
}
create("icmDockerReadmePlugin") {
id = "com.intershop.gradle.icm.docker.readmepush"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerReadmePushPlugin"
displayName = "icm-readmepush-plugin"
description = "This ICM plugin integrates tasks to readme files to Dockerhub."
}
create("icmDockerCustomizationPlugin") {
id = "com.intershop.gradle.icm.docker.customization"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerCustomizationPlugin"
displayName = "icm-docker-customization-plugin"
description = "This ICM plugin integrate Docker tasks to an ICM customization project."
}
create("icmSolrCloudPlugin") {
id = "com.intershop.gradle.icm.docker.solrcloud"
implementationClass = "com.intershop.gradle.icm.docker.ICMSolrCloudPlugin"
displayName = "icm-solrlcloud-plugin"
description = "This ICM plugin integrates tasks to maintain a ICM project."
}
create("icmGebTestPlugin") {
id = "com.intershop.gradle.icm.docker.gebtest"
implementationClass = "com.intershop.gradle.icm.docker.ICMGebTestPlugin"
displayName = "icm-gebtest-plugin"
description = "This ICM plugin integrates tasks to handle Geb Tests in a ICM project."
}
}
}

pluginBundle {
val pluginURL = "https://github.com/IntershopCommunicationsAG/${project.name}"
website = pluginURL
vcsUrl = pluginURL
tags = listOf("intershop", "build", "icm", "docker")
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

withSourcesJar()
}

// set correct project status
Expand All @@ -77,7 +130,7 @@ if (project.version.toString().endsWith("-SNAPSHOT")) {
}

detekt {
input = files("src/main/kotlin")
source = files("src/main/kotlin")
config = files("detekt.yml")
}

Expand All @@ -93,7 +146,7 @@ tasks {
}

withType<Test>().configureEach {
systemProperty("intershop.gradle.versions", "7.2")
systemProperty("intershop.gradle.versions", "7.5.1")

testLogging {
showStandardStreams = true
Expand All @@ -103,7 +156,7 @@ tasks {
dependsOn("jar")
}

val copyAsciiDoc = register<Copy>("copyAsciiDoc") {
register<Copy>("copyAsciiDoc") {
includeEmptyDirs = false

val outputDir = file("$buildDir/tmp/asciidoctorSrc")
Expand All @@ -124,7 +177,7 @@ tasks {
}

withType<AsciidoctorTask> {
dependsOn(copyAsciiDoc)
dependsOn("copyAsciiDoc")

setSourceDir(file("$buildDir/tmp/asciidoctorSrc"))
sources(delegateClosureOf<PatternSet> {
Expand Down Expand Up @@ -167,74 +220,29 @@ tasks {
outputDirectory.set(buildDir.resolve("dokka"))
}

register<Jar>("javaDoc") {
dependsOn(dokkaJavadoc)
from(dokkaJavadoc)
archiveClassifier.set("javadoc")
}
}

gradlePlugin {
plugins {
create("icmDockerPlugin") {
id = "com.intershop.gradle.icm.docker"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerPlugin"
displayName = "icm-docker-plugin"
description = "This ICM plugin contains Docker ICM integration."
}
create("icmDockerTestProjectPlugin") {
id = "com.intershop.gradle.icm.docker.test"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerTestPlugin"
displayName = "icm-docker-test-plugin"
description = "This ICM plugin contains special Docker tasks for special test container."
}
create("icmDockerReadmePlugin") {
id = "com.intershop.gradle.icm.docker.readmepush"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerReadmePushPlugin"
displayName = "icm-readmepush-plugin"
description = "This ICM plugin integrates tasks to readme files to Dockerhub."
}
create("icmDockerProjectPlugin") {
id = "com.intershop.gradle.icm.docker.project"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerProjectPlugin"
displayName = "icm-docker-project-plugin"
description = "This ICM plugin integrate Docker tasks to an ICM project."
}
create("icmDockerCustomizationPlugin") {
id = "com.intershop.gradle.icm.docker.customization"
implementationClass = "com.intershop.gradle.icm.docker.ICMDockerCustomizationPlugin"
displayName = "icm-docker-customization-plugin"
description = "This ICM plugin integrate Docker tasks to an ICM customization project."
withType<Sign> {
val sign = this
withType<PublishToMavenLocal> {
this.dependsOn(sign)
}
create("icmSolrCloudPlugin") {
id = "com.intershop.gradle.icm.docker.solrcloud"
implementationClass = "com.intershop.gradle.icm.docker.ICMSolrCloudPlugin"
displayName = "icm-solrlcloud-plugin"
description = "This ICM plugin integrates tasks to maintain a ICM project."
}
create("icmGebTestPlugin") {
id = "com.intershop.gradle.icm.docker.gebtest"
implementationClass = "com.intershop.gradle.icm.docker.ICMGebTestPlugin"
displayName = "icm-gebtest-plugin"
description = "This ICM plugin integrates tasks to handle Geb Tests in a ICM project."
withType<PublishToMavenRepository> {
this.dependsOn(sign)
}
}
}

pluginBundle {
val pluginURL = "https://github.com/IntershopCommunicationsAG/${project.name}"
website = pluginURL
vcsUrl = pluginURL
tags = listOf("intershop", "gradle", "plugin", "build", "icm", "docker")
afterEvaluate {
getByName<Jar>("javadocJar") {
dependsOn(dokkaJavadoc)
from(dokkaJavadoc)
}
}
}

publishing {
publications {
create("intershopMvn", MavenPublication::class.java) {
from(components["java"])

artifact(tasks.getByName("javaDoc"))

artifact(File(buildDir, "docs/asciidoc/html5/README.html")) {
classifier = "reference"
}
Expand Down Expand Up @@ -297,18 +305,11 @@ dependencies {
implementation(gradleKotlinDsl())

implementation("org.apache.solr:solr-solrj:8.11.2")
implementation("com.bmuschko:gradle-docker-plugin:7.1.0")
implementation("com.intershop.gradle.icm:icm-gradle-plugin:5.5.1")
implementation("com.bmuschko:gradle-docker-plugin:8.1.0")
implementation("com.intershop.gradle.icm:icm-gradle-plugin:5.6.0")
implementation("com.intershop.gradle.jobrunner:icmjobrunner:1.0.5")

testImplementation("com.intershop.gradle.test:test-gradle-plugin:4.1.1")
testImplementation("com.intershop.gradle.test:test-gradle-plugin:4.1.2")
testImplementation(gradleTestKit())
}

repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
61 changes: 30 additions & 31 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ build:
maxIssues: 0
excludeCorrectable: false
weights:
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1

config:
validation: true
Expand All @@ -25,15 +25,14 @@ processors:
console-reports:
active: true
exclude:
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
# - 'FindingsReport'
- 'FileBasedFindingsReport'
- 'ProjectStatisticsReport'
- 'ComplexityReport'
- 'NotificationReport'
# - 'FindingsReport'
- 'FileBasedFindingsReport'

comments:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
AbsentOrWrongFileLicense:
active: false
licenseTemplateFile: 'license.template'
Expand Down Expand Up @@ -105,7 +104,7 @@ complexity:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
thresholdInFiles: 15
thresholdInClasses: 15
thresholdInClasses: 40
thresholdInInterfaces: 15
thresholdInObjects: 15
thresholdInEnums: 15
Expand Down Expand Up @@ -175,10 +174,10 @@ exceptions:
SwallowedException:
active: false
ignoredExceptionTypes:
- InterruptedException
- NumberFormatException
- ParseException
- MalformedURLException
- InterruptedException
- NumberFormatException
- ParseException
- MalformedURLException
allowedExceptionNameRegex: '_|(ignore|expected).*'
ThrowingExceptionFromFinally:
active: false
Expand All @@ -187,31 +186,31 @@ exceptions:
ThrowingExceptionsWithoutMessageOrCause:
active: false
exceptions:
- IllegalArgumentException
- IllegalStateException
- IOException
- IllegalArgumentException
- IllegalStateException
- IOException
ThrowingNewInstanceOfSameException:
active: false
TooGenericExceptionCaught:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
- Exception
- IllegalMonitorStateException
- NullPointerException
- IndexOutOfBoundsException
- RuntimeException
- Throwable
- ArrayIndexOutOfBoundsException
- Error
- Exception
- IllegalMonitorStateException
- NullPointerException
- IndexOutOfBoundsException
- RuntimeException
- Throwable
allowedExceptionNameRegex: '_|(ignore|expected).*'
TooGenericExceptionThrown:
active: true
exceptionNames:
- Error
- Exception
- Throwable
- RuntimeException
- Error
- Exception
- Throwable
- RuntimeException

formatting:
active: true
Expand Down Expand Up @@ -570,7 +569,7 @@ style:
excludeReturnFromLambda: true
excludeGuardClauses: false
SafeCast:
active: false
active: true
SerialVersionUIDInSerializableClass:
active: false
SpacingBetweenPackageAndImports:
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
Loading

0 comments on commit 584e731

Please sign in to comment.