Skip to content

Commit

Permalink
[gradle] Migrate to Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Jun 20, 2020
1 parent 7195b2c commit 83a7a3a
Show file tree
Hide file tree
Showing 478 changed files with 2,268 additions and 18,341 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.iml
.idea
repository
data/*
target
history.json
/.idea
/data/*
/.gradle
build
/autoReferee
4 changes: 2 additions & 2 deletions .idea/runConfigurations/AutoReferee.xml

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

110 changes: 0 additions & 110 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 0 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties

This file was deleted.

17 changes: 0 additions & 17 deletions .project

This file was deleted.

18 changes: 0 additions & 18 deletions AutoReferee.launch

This file was deleted.

2 changes: 1 addition & 1 deletion license.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The TIGERS Mannheim provide their source code free of charge.
The TIGERs Mannheim provide their source code, electrical schematics and board layouts and mechanical CAD drawings free of charge.

You are allowed to use it for any educational, research or non-commercial purpose, especially for participating at RoboCup itself.

Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# TIGERs Mannheim AutoReferee

Homepage: https://www.tigers-mannheim.de
Mail: management@tigers-mannheim.de
Homepage: https://tigers-mannheim.de
Mail: info@tigers-mannheim.de

This is the AutoReferee implementation of TIGERs Mannheim. It is based on Sumatra, our AI framework.
We use Maven for building the application. You can also use IntelliJ or Eclipse to build and run it. The required configuration files are included.
Dependencies will be downloaded from Maven repositories, so you need an internet connection for the build.
We use Gradle for building the application and IntelliJ as the primary IDE.
All dependencies will be downloaded automatically, so you need an internet connection for the build.

## System Requirements
* Java JDK 8
* Maven
* Internet connection
* no limitations on OS known

## Build
Configuration for IntelliJ and Eclipse is provided and should work out-of-the-box. Without an IDE, run `./build.sh` or `./build.bat`, depending on your system platform.
Run `./build.sh` or `./build.bat`, depending on your system platform.

## Run from command line
Run `run.sh <mode>` or `run.bat`, where <mode> must be replaced with either `active` or `passive`. For Windows, the
mode must be changed in the script. It is passive by default.
## Run
Run `./run.sh` or `run.bat`, depending on your system platform.

You can pass `-h` to get the available arguments.

## IntelliJ
IntelliJ reads the Gradle configuration and can use Gradle to perform the build.
Make sure to configure Gradle for build and tests under Build, Execution, Deployment -> Build Tools -> Gradle.

# Usage

Expand Down Expand Up @@ -68,10 +72,3 @@ ssl-vision.
The autoRef ships with the official ssl-game-controller. To activate it, change `gameController` to true in [config/moduli/moduli.xml](config/moduli/moduli.xml). The autoRef will internally launch the game-controller and connect to its websocket API
to be able to send some basic commands through the **Ref** view. This view also contains a button to launch the full
game-controller UI.

## Recording Gameplay
The autoRef can automatically start and stop recordings when a game starts/stops. To enable this feature, have a look in [run.sh](run.sh).
The recording consumes a lot of memory. That's why by default, the heap size is set to 4GB. Make sure that your system has sufficient free memory. The recordings are stored in [data/record](data/record). They can grow to several Gigabyte, as they are stored uncompressed.
Zipping the output files significantly reduces the size.

You can access the replays by right-clicking a row in the GameLog view. This will jump directly to the time, the infringement occurred (30 seconds before). After a recording was closed, it can be accessed from the menu.
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ECHO OFF

cd %~dp0

mvnw clean install -Pfast -Dmaven.repo.local=repository
gradlew build -x test
146 changes: 146 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/*
* Copyright (c) 2009 - 2020, DHBW Mannheim - TIGERs Mannheim
*/

plugins {
id "java"
id "jacoco"
id "idea"
id "application"

id "com.google.protobuf" version "0.8.12" apply false
id "com.palantir.git-version" version "0.12.3"
id "ca.cutterslade.analyze" version "1.4.1"
id "com.google.cloud.tools.jib" version "2.4.0"
}

version versionDetails().lastTag + "-" + versionDetails().gitHash

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

maven {
url = 'https://jitpack.io/'
}

maven {
url = 'https://download.oracle.com/maven'
}

jcenter()
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'ca.cutterslade.analyze'

sourceCompatibility = '1.8'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

test {
exclude '**/*PerfTest.class'
exclude '**/*IntegrationTest.class'
}

jacoco {
toolVersion = "0.8.5"
}

jacocoTestReport {
reports {
xml.enabled = true
csv.enabled = false
html.enabled = false
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/proto/**/*'])
}))
}

dependsOn(test)
}
}

tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}

dependencies {
implementation project(':autoreferee-gui')

implementation project(':common-gui')
implementation project(':common-gui-config')

implementation project(':sumatra-model')
implementation project(':sumatra-gui-log')
implementation project(':sumatra-gui-referee')
implementation project(':sumatra-gui-replay')
implementation project(':sumatra-gui-visualizer')

implementation project(':moduli-record')
implementation project(':moduli-autoreferee')
runtimeOnly project(':moduli-wp')
runtimeOnly project(':moduli-referee')

implementation 'com.github.TIGERs-Mannheim:moduli:2.2'
implementation 'com.github.TIGERs-Mannheim:infonode:1.7.0'

implementation 'org.apache.logging.log4j:log4j-api:2.12.1'
runtimeOnly 'org.apache.logging.log4j:log4j-core:2.12.1'
runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api:2.12.1'
runtimeOnly 'org.slf4j:slf4j-log4j12:1.7.25'

implementation 'commons-cli:commons-cli:1.4'
}

application {
mainClass.set('edu.tigers.autoref.AutoReferee')
applicationDefaultJvmArgs = [
'-Xms64m',
'-Xmx2G',
'-server',
'-Dsun.java2d.d3d=false',
'-Djava.net.preferIPv4Stack=true',
]
}

jib {
to {
image = "registry.hub.docker.com/tigersmannheim/auto-referee:latest"
auth {
username = System.getenv("DOCKER_HUB_USERNAME")
password = System.getenv("DOCKER_HUB_PASSWORD")
}
tags = [rootProject.version]
}
from {
// gcr.io/distroless/java:8
image = "gcr.io/distroless/java@sha256:7cef6d99241bc86e09659d41842e3656a1cab99adf0e440a44d2858c8e52a71a"
}
container {
workingDirectory = "/AutoReferee"
}
}

run.workingDir = rootProject.projectDir

// set version here to avoid overriding the project version.
// version is set to null to skip it completely in the artifact names
// Thus, it is guaranteed that old artifacts are always overwritten.
distZip.archiveVersion.convention(null)
jar.archiveVersion.convention(null)

// disable tar distribution to avoid redundant artifacts
distTar.enabled = false
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash

args="${@}"
./mvnw clean install -Pfast -Dmaven.repo.local=repository ${args}
./gradlew build -x test
rm -rf autoReferee
unzip build/distributions/autoReferee.zip
Loading

0 comments on commit 83a7a3a

Please sign in to comment.