Skip to content

Commit

Permalink
Merge pull request #234 from LossyDragon/projVersion
Browse files Browse the repository at this point in the history
Port dependencies to Gradle Versions Catalog
  • Loading branch information
LossyDragon authored Oct 13, 2023
2 parents 11eebcb + 4c6c15e commit 44cc9fe
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 87 deletions.
24 changes: 24 additions & 0 deletions .run/javasteam [build].run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="javasteam [build]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-x signMavenJavaPublication" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions .run/javasteam [clean build].run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="javasteam [clean build]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-x signMavenJavaPublication" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
26 changes: 26 additions & 0 deletions .run/javasteam [wrapper --gradle-version 8.4].run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="javasteam [wrapper --gradle-version 8.4]" type="GradleRunConfiguration" factoryName="Gradle" nameIsGenerated="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="wrapper" />
<option value="--gradle-version" />
<option value="8.4" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
69 changes: 19 additions & 50 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//file:noinspection GroovyAssignabilityCheck

// https://mvnrepository.com/artifact/io.github.gradle-nexus/publish-plugin
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'com.google.protobuf' version "0.9.4"
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.maven.publish)
alias(libs.plugins.protobuf.gradle)
id 'jacoco'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.9.0'
id 'projectversiongen'
id 'signing'
id 'steamlanguagegen'
Expand All @@ -18,19 +16,17 @@ allprojects {
version '1.3.0'
}

sourceCompatibility = 1.8
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())

repositories {
mavenCentral()
}

// https://mvnrepository.com/artifact/com.google.protobuf/protoc
protobuf.protoc {
artifact = 'com.google.protobuf:protoc:3.22.4'
artifact = libs.protobuf.protoc.get()
}

// https://www.eclemma.org/jacoco
jacoco.toolVersion = "0.8.10"
jacoco.toolVersion = libs.versions.jacoco.get()

jacocoTestReport.reports {
xml.required = true
Expand All @@ -50,15 +46,15 @@ java {
withJavadocJar()
}

// Note: Only allow junit 5
// Only allow junit 5
configurations {
configureEach {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}

// Note: builtBy() fixes gradle warning "Execution optimizations have been disabled for task"
// builtBy() fixes gradle warning "Execution optimizations have been disabled for task"
sourceSets.main {
java.srcDirs(
files("build/generated/source/steamd/main/java").builtBy(generateSteamLanguage),
Expand All @@ -71,44 +67,17 @@ compileJava.dependsOn(generateSteamLanguage)
compileJava.dependsOn(generateProjectVersion)

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'

// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation 'com.google.code.gson:gson:2.10.1'
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation 'com.google.protobuf:protobuf-java:3.22.4'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
// https://mvnrepository.com/artifact/commons-validator/commons-validator
implementation 'commons-validator:commons-validator:1.7'
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation 'org.apache.commons:commons-lang3:3.12.0'
// https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
implementation 'org.java-websocket:Java-WebSocket:1.5.4'
// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.13.0'

/* Unit Testing */

// https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver3-junit5
testImplementation 'com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.11'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
testImplementation 'commons-codec:commons-codec:1.16.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.70'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation 'org.mockito:mockito-core:4.11.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testImplementation 'org.mockito:mockito-junit-jupiter:4.11.0'
implementation libs.commons.io
implementation libs.commons.lang3
implementation libs.commons.validator
implementation libs.gson
implementation libs.kotlin.coroutines
implementation libs.kotlin.stdib
implementation libs.okHttp
implementation libs.protobuf.java
implementation libs.webSocket

testImplementation libs.bundles.testing
}

/* Artifact publishing */
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
implementation localGroovy()

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.13.0'
implementation 'commons-io:commons-io:2.14.0'
}

gradlePlugin {
Expand Down
64 changes: 64 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[versions]
# Java / Kotlin versions
java = "1.8"
kotlin = "1.9.10" # https://kotlinlang.org/docs/releases.html#release-details

# Standard Library versions
bouncyCastle = "1.70" # https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
commons-io = "2.14.0" # https://mvnrepository.com/artifact/commons-io/commons-io
commons-lang3 = "3.13.0" # https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
commons-validator = "1.7" # https://mvnrepository.com/artifact/commons-validator/commons-validator
gson = "2.10.1" # https://mvnrepository.com/artifact/com.google.code.gson/gson
jacoco = "0.8.10" # https://www.eclemma.org/jacoco
javaWebSocket = "1.5.4" # https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket
kotlin-coroutines = "1.7.3" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
okHttp = "4.11.0" # https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
protobuf = "3.23.4" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
protobuf-gradle = "0.9.4" # https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
publishPlugin = "1.1.0" # https://mvnrepository.com/artifact/io.github.gradle-nexus/publish-plugin
qrCode = "1.0.1" # https://mvnrepository.com/artifact/pro.leaco.qrcode/console-qrcode

# Testing Lib versions
commonsCodec = "1.16.0" # https://mvnrepository.com/artifact/commons-codec/commons-codec
jupiterVersion = "5.10.0" # https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
mockWebServer = "5.0.0-alpha.11" # https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver3-junit5
mockitoVersion = "4.11.0" # https://mvnrepository.com/artifact/org.mockito/mockito-core

[libraries]
bouncyCastle = { module = "org.bouncycastle:bcprov-jdk15on", version.ref = "bouncyCastle" }
commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" }
commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3" }
commons-validator = { module = "commons-validator:commons-validator", version.ref = "commons-validator" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
kotlin-stdib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okHttp" }
protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "protobuf" }
protobuf-protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" }
qrCode = { module = "pro.leaco.qrcode:console-qrcode", version.ref = "qrCode" }
webSocket = { module = "org.java-websocket:Java-WebSocket", version.ref = "javaWebSocket" }

test-commons-codec = { module = "commons-codec:commons-codec", version.ref = "commonsCodec" }
test-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiterVersion" }
test-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "jupiterVersion" }
test-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "jupiterVersion" }
test-mock-webserver3 = { module = "com.squareup.okhttp3:mockwebserver3-junit5", version.ref = "mockWebServer" }
test-mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoVersion" }
test-mockito-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockitoVersion" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
maven-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publishPlugin" }
protobuf-gradle = { id = "com.google.protobuf", version.ref = "protobuf-gradle" }

[bundles]
testing = [
"bouncyCastle",
"test-commons-codec",
"test-jupiter-api",
"test-jupiter-engine",
"test-jupiter-params",
"test-mockito-core",
"test-mockito-jupiter",
"test-mock-webserver3"
]
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.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
27 changes: 8 additions & 19 deletions javasteam-samples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.0'
alias(libs.plugins.kotlin.jvm)
}

sourceCompatibility = 1.8
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())

repositories {
mavenCentral()
Expand All @@ -11,22 +11,11 @@ repositories {
dependencies {
implementation rootProject

// https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation libs.bouncyCastle
implementation libs.gson
implementation libs.kotlin.coroutines
implementation libs.protobuf.java // To access protobufs directly as shown in Sample #2
implementation libs.qrCode

// https://mvnrepository.com/artifact/pro.leaco.qrcode/console-qrcode
implementation 'pro.leaco.qrcode:console-qrcode:1.0.1'

// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation 'com.google.code.gson:gson:2.10.1'

// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'

// To access protobufs directly as shown in Sample #2
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation 'com.google.protobuf:protobuf-java:3.22.4'

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation libs.test.jupiter.api
}
20 changes: 4 additions & 16 deletions javasteam-tf/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,33 @@
//file:noinspection GroovyAssignabilityCheck

// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-gradle-plugin
plugins {
id 'com.google.protobuf' version "0.9.4"
alias(libs.plugins.protobuf.gradle)
id 'java'
id 'maven-publish'
id 'signing'
}

sourceCompatibility = 1.8
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.get())

repositories {
mavenCentral()
}

// https://mvnrepository.com/artifact/com.google.protobuf/protoc
protobuf.protoc {
artifact = 'com.google.protobuf:protoc:3.23.4'
artifact = libs.protobuf.protoc.get()
}

javadoc {
exclude "**/in/dragonbra/javasteam/protobufs/**"
}

test {
useJUnitPlatform()
}

java {
withSourcesJar()
withJavadocJar()
}

dependencies {
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation 'com.google.protobuf:protobuf-java:3.23.4'

/* Unit Testing */

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
implementation libs.protobuf.java
}

/* Artifact publishing */
Expand Down

0 comments on commit 44cc9fe

Please sign in to comment.