Skip to content

Commit

Permalink
Merge pull request #640 from hexagonkt/develop
Browse files Browse the repository at this point in the history
Improve starter scripts
  • Loading branch information
jaguililla authored Jul 4, 2023
2 parents d2595fc + 6823606 commit bbd24fb
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 98 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.github.jk1.license.render.ReportRenderer
* 1. Publishing: upload binaries and templates to Maven Central
* 2. Releasing: tag source code in GitHub
* 3. Coverage report: aggregated coverage report for all modules
* 4. Handle Docker containers: take care of tasks depending on Docker and containers clean up
*
* Plugins that are not used in the root project (this one) are only applied by the modules that use
* them.
Expand Down
5 changes: 5 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ apply(from = "$rootDir/gradle/detekt.gradle")
description = "Hexagon core utilities. Includes logging helpers."

dependencies {
val scriptMockkVersion = findProperty("mockkVersion")

"api"("org.jetbrains.kotlin:kotlin-stdlib")

"testImplementation"("org.jetbrains.kotlin:kotlin-reflect")
"testImplementation"("io.mockk:mockk:$scriptMockkVersion") {
exclude(group = "org.jetbrains.kotlin")
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.warning.mode=all
org.gradle.console=plain

# Gradle
version=3.0.0-B6
version=3.0.0-B7
group=com.hexagonkt
description=The atoms of your platform

Expand Down Expand Up @@ -37,7 +37,7 @@ mockkVersion=1.13.5
junitVersion=5.9.3
gatlingVersion=3.9.5
jmhVersion=1.36
mkdocsMaterialVersion=9.1.17
mkdocsMaterialVersion=9.1.18
mermaidDokkaVersion=0.4.4
nativeToolsVersion=0.9.23

Expand Down
4 changes: 0 additions & 4 deletions gradle/kotlin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ repositories {
}

dependencies {
final String scriptMockkVersion = findProperty("mockkVersion") ?: "1.13.5"
final String scriptJunitVersion = findProperty("junitVersion") ?: "5.9.3"

implementation("org.jetbrains.kotlin:kotlin-stdlib")

testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.junit.jupiter:junit-jupiter:$scriptJunitVersion")
testImplementation("io.mockk:mockk:$scriptMockkVersion") {
exclude(group: "org.jetbrains.kotlin")
}
}

// Replace build variables in resource files
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
2 changes: 1 addition & 1 deletion handlers_async/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ apply(from = "$rootDir/gradle/native.gradle")
apply(from = "$rootDir/gradle/detekt.gradle")
apply(from = "$rootDir/gradle/jmh.gradle")

description = "Handlers to be applied on events processing."
description = "Asynchronous handlers to be applied on events processing."
12 changes: 6 additions & 6 deletions starters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ This module holds the Maven parent POMs with Kotlin setup to ease the project cr

```xml
<parent>
<groupId>com.hexagonkt</groupId>
<artifactId>kotlin_pom</artifactId>
<version>$VERSION</version>
<groupId>com.hexagonkt</groupId>
<artifactId>kotlin_pom</artifactId>
<version>$VERSION</version>
</parent>
```

Or:

```xml
<parent>
<groupId>com.hexagonkt</groupId>
<artifactId>kotlin_lean_pom</artifactId>
<version>$VERSION</version>
<groupId>com.hexagonkt</groupId>
<artifactId>kotlin_lean_pom</artifactId>
<version>$VERSION</version>
</parent>
```
11 changes: 2 additions & 9 deletions starters/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ apply(from = "../gradle/publish.gradle")
extensions.configure<PublishingExtension> {
publications {
createPomPublication("hexagon_bom") { pomDom ->
properties.set(mapOf(
"kotlin.version" to project.properties["kotlinVersion"].toString(),
"mockk.version" to project.properties["mockkVersion"].toString(),
"junit.version" to project.properties["junitVersion"].toString(),
"hexagon.version" to rootProject.version.toString()
))
properties.set(mapOf("hexagon.version" to rootProject.version.toString()))

withXml {
listOf("dependencyManagement").forEach {
Expand All @@ -39,14 +34,12 @@ extensions.configure<PublishingExtension> {
"kotlin.compiler.jvmTarget" to target,
"kotlin.version" to project.properties["kotlinVersion"].toString(),
"dokka.version" to project.properties["dokkaVersion"].toString(),
"mockk.version" to project.properties["mockkVersion"].toString(),
"junit.version" to project.properties["junitVersion"].toString(),
"native.tools.version" to project.properties["nativeToolsVersion"].toString(),
"hexagon.version" to rootProject.version.toString()
))

withXml {
listOf("dependencyManagement", "dependencies", "build").forEach {
listOf("dependencies", "build").forEach {
asElement().importElement(pomDom.firstElement(it))
}
}
Expand Down
40 changes: 0 additions & 40 deletions starters/hexagon_bom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@

<dependencyManagement>
<dependencies>
<!-- Kotlin -->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>

<!-- Hexagon -->
<dependency>
<groupId>com.hexagonkt</groupId>
<artifactId>core</artifactId>
Expand Down Expand Up @@ -197,33 +184,6 @@
<artifactId>templates_test</artifactId>
<version>${hexagon.version}</version>
</dependency>

<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<version>${mockk.version}</version>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
</project>
90 changes: 57 additions & 33 deletions starters/kotlin_pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,16 @@
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.mockk</groupId>
<artifactId>mockk</artifactId>
<scope>test</scope>
<version>${kotlin.version}</version>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.hexagonkt</groupId>
<artifactId>hexagon_bom</artifactId>
<version>${hexagon.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<defaultGoal>verify</defaultGoal>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
Expand All @@ -57,15 +42,54 @@

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>

<configuration>
<jvmTarget>${maven.compiler.target}</jvmTarget>
</configuration>

<executions>
<execution>
<id>compile</id>
Expand All @@ -88,7 +112,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<configuration>
<filesets>
<fileset>
Expand Down Expand Up @@ -119,31 +143,31 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<archive>
<manifest>
<mainClass>${exec.mainClass}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>${exec.mainClass}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down

0 comments on commit bbd24fb

Please sign in to comment.