Skip to content

Commit

Permalink
Release 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Jul 22, 2024
1 parent b8f3bf7 commit 8613872
Show file tree
Hide file tree
Showing 681 changed files with 27,189 additions and 8,905 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on: push

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 21
distribution: temurin
- name: Build
run: ./gradlew build
- name: IntegrationTest
run: ./gradlew integrationTest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ build
/sumatra
temp
cache

out
**/test/generated_tests
**/integrationTest/generated
4 changes: 3 additions & 1 deletion .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 7 additions & 20 deletions .idea/runConfigurations/Sumatra.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ All dependencies will be downloaded automatically, so you need an internet conne

## System Requirements

* Java JDK 17
* Java JDK (recent LTS version, exact required version can be
found [here](buildSrc/src/main/groovy/sumatra.java.gradle))
* Internet connection
* Some optional features require native libraries (like screencasting or gamepad support), so some more exotic
architectures may not fully be supported
Expand Down Expand Up @@ -86,7 +87,7 @@ Make sure you disable the AIs that are not used by switching them to OFF in the
The simulation can only be controlled from the server. The game-controller is also running on the server. You can use
the autoRef on the server as well. The client only provides the AI including the skill system.

To simplify the setup, there is a docker-compose setup. It is
To simplify the setup, there is a docker compose setup. It is
described [here](./modules/moduli-statistics-saver/Readme.md).

## Further Documentation
Expand Down
40 changes: 27 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'com.palantir.git-version' version '3.0.0'
id 'org.sonarqube'
alias(libs.plugins.sonar)
alias(libs.plugins.versionCatalogUpdate)
id 'idea'

id 'sumatra.java'
id 'sumatra.jib'
id 'sumatra.application'
}

ext.versionPrefix = 'merge/'
ext.versionDetails = versionDetails(prefix: versionPrefix)
version versionDetails.lastTag + '-' + versionDetails.gitHash
def gitDescribe = providers.exec {
commandLine("git", "describe", "--tags", "--always", "--first-parent")
}.standardOutput.asText.map { it.replace("merge/", "").trim() }

version gitDescribe.get()

processResources {
inputs.property("project.version", rootProject.versionDetails.lastTag)
inputs.property("project.version", project.version)
filter ReplaceTokens, tokens: [
"application.version": rootProject.versionDetails.lastTag,
"application.version": project.version,
]
}

Expand Down Expand Up @@ -55,16 +57,16 @@ dependencies {
implementation project(':moduli-ai-controller')
implementation project(':moduli-vision-simulation')
implementation project(':moduli-autoreferee')
runtimeOnly project(':moduli-autoreferee-ci')
runtimeOnly project(':moduli-team-client')
implementation project(':moduli-bot-params')
runtimeOnly project(':moduli-log-analysis')

implementation 'com.github.TIGERs-Mannheim:moduli:4.1'
implementation(libs.com.github.TIGERs.mannheim.moduli)

implementation 'org.apache.logging.log4j:log4j-api:2.20.0'
runtimeOnly 'org.apache.logging.log4j:log4j-core:2.20.0'
implementation(libs.org.apache.logging.log4j.log4j.api)
runtimeOnly(libs.org.apache.logging.log4j.log4j.core)

implementation 'commons-cli:commons-cli:1.5.0'
implementation(libs.commons.cli)
}

application {
Expand Down Expand Up @@ -105,7 +107,7 @@ jib {
sonarqube {
properties {
property "sonar.projectKey", "main_Sumatra_AXyeyj5BLG1xSGHUS0Xf"
property "sonar.projectVersion", versionDetails.lastTag
property "sonar.projectVersion", gitDescribe
property "sonar.host.url", System.getenv("SONARQUBE_URL")
property "sonar.login", System.getenv("SONARQUBE_AUTH_TOKEN")
if (System.getenv("CI_MERGE_REQUEST_IID") != null) {
Expand All @@ -117,3 +119,15 @@ sonarqube {
}
}
}

def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA', 'JRE'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9v]{1,3}\.([0-9,.v-]|(groovy))+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}

versionCatalogUpdate {
versionSelector {
!isNonStable(it.candidate.version)
}
}
17 changes: 3 additions & 14 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
plugins {
id 'groovy-gradle-plugin'
id("com.github.ben-manes.versions") version "0.47.0"
id("se.patrikerdes.use-latest-versions") version "0.2.18"
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.2.1.3168")
implementation("com.google.cloud.tools:jib-gradle-plugin:3.3.2")
implementation("com.github.ben-manes:gradle-versions-plugin:0.47.0")
implementation("se.patrikerdes:gradle-use-latest-versions-plugin:0.2.18")
implementation("ca.cutterslade.analyze:ca.cutterslade.analyze.gradle.plugin:1.9.1")
implementation("com.google.protobuf:protobuf-gradle-plugin:0.9.3")
}

tasks.withType(com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask).configureEach {
rejectVersionIf {
!(it.candidate.version ==~ /[0-9.]+/)
}
implementation(libs.plugin.jib)
implementation(libs.plugin.dependency.analysis)
implementation(libs.plugin.protobuf)
}
8 changes: 8 additions & 0 deletions buildSrc/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
rootProject.name = 'buildSrc'

dependencyResolutionManagement {
versionCatalogs {
libs {
from(files("../gradle/libs.versions.toml"))
}
}
}
1 change: 0 additions & 1 deletion buildSrc/src/main/groovy/sumatra.application.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

application {
applicationDefaultJvmArgs = [
'-server',
'-Dsun.java2d.d3d=false',
'-Djava.net.preferIPv4Stack=true',
]
Expand Down
13 changes: 4 additions & 9 deletions buildSrc/src/main/groovy/sumatra.java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ plugins {
id 'groovy' // apply to all due to issues when only applying to some projects
id 'idea'
id 'ca.cutterslade.analyze'
id 'sumatra.versions'
}

repositories {
maven {
url = 'https://nexus.tigers-mannheim.de/content/groups/public/'
}

mavenCentral()

maven {
Expand All @@ -27,14 +22,14 @@ tasks.withType(JavaCompile).configureEach {
}

dependencies {
annotationProcessor "org.projectlombok:lombok:1.18.28"
compileOnly "org.projectlombok:lombok:1.18.28"
permitUnusedDeclared "org.projectlombok:lombok:1.18.28"
annotationProcessor(libs.org.projectlombok.lombok)
compileOnly(libs.org.projectlombok.lombok)
permitUnusedDeclared(libs.org.projectlombok.lombok)
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/sumatra.jib.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jib {
tags = [rootProject.version]
}
from {
image = "ghcr.io/graalvm/jdk@sha256:baa525245fe29647d396c6a2e14caca6305b7800513da0aae47b2d4965894d62"
image = "ghcr.io/graalvm/jdk-community@sha256:57e5c4cf8536dac4346611691c31ea4828f3ff7bbb0d3695902b234f69ed99b5"
}
container.jvmFlags = [
'-Djava.net.preferIPv4Stack=true',
Expand Down
18 changes: 1 addition & 17 deletions buildSrc/src/main/groovy/sumatra.protobuf.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ plugins {

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.23.2'
}
// See: https://github.com/protocolbuffers/protobuf/issues/7271
generateProtoTasks {
all().each { task ->
task.doLast {
ant.replaceregexp(
match: '@java.lang.Deprecated|@deprecated',
replace: '',
flags: 'g',
byline: true
) {
fileset(
dir: "${protobuf.generatedFilesBaseDir}/main/java")
}
}
}
artifact = libs.com.google.protobuf.protoc.get()
}
}
21 changes: 11 additions & 10 deletions buildSrc/src/main/groovy/sumatra.test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ plugins {

dependencies {
// Support old junit4 syntax for now
testImplementation 'junit:junit:4.13.2'
permitTestUnusedDeclared 'junit:junit:4.13.2'
testImplementation(libs.junit)
permitTestUnusedDeclared(libs.junit)
// Support junit 5
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
permitTestUnusedDeclared 'org.junit.jupiter:junit-jupiter:5.9.3'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.3'
testImplementation(libs.org.junit.jupiter.junit.jupiter)
permitTestUnusedDeclared(libs.org.junit.jupiter.junit.jupiter)
testRuntimeOnly(libs.org.junit.vintage.junit.vintage.engine)
testRuntimeOnly(libs.org.junit.platform.junit.platform.launcher)

// Add common test tools
testImplementation 'org.assertj:assertj-core:3.24.2'
permitTestUnusedDeclared 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.mockito:mockito-all:1.10.19'
permitTestUnusedDeclared 'org.mockito:mockito-all:1.10.19'
testImplementation(libs.org.assertj.assertj.core)
permitTestUnusedDeclared(libs.org.assertj.assertj.core)
testImplementation(libs.org.mockito.mockito.all)
permitTestUnusedDeclared(libs.org.mockito.mockito.all)
}

test {
Expand All @@ -28,7 +29,7 @@ test {
}

jacoco {
toolVersion = "0.8.9"
toolVersion = libs.versions.org.jacoco.get()
}

jacocoTestReport {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/sumatra.test.spock.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ plugins {

dependencies {
// Specific groovy version
testImplementation platform('org.apache.groovy:groovy-bom:4.0.12')
testImplementation(platform(libs.org.apache.groovy.groovy.bom))

testImplementation 'org.apache.groovy:groovy'
testRuntimeOnly 'org.apache.groovy:groovy-templates'
testRuntimeOnly 'org.apache.groovy:groovy-xml'
testRuntimeOnly 'org.apache.groovy:groovy-json'

// Spock
testImplementation platform('org.spockframework:spock-bom:2.3-groovy-4.0')
testImplementation(platform(libs.org.spockframework.spock.bom))
testImplementation 'org.spockframework:spock-core'
}
1 change: 1 addition & 0 deletions config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/user.xml
*.props
*.layers
/engine.yaml
Loading

0 comments on commit 8613872

Please sign in to comment.