Skip to content

Commit

Permalink
Merge pull request #8 from rwth-acis/java17
Browse files Browse the repository at this point in the history
Java17
  • Loading branch information
AlexanderNeumann authored Jan 10, 2022
2 parents 9e725f5 + e78edd1 commit 13f2abf
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker Build and Push

on:
push:
branches: [ master, develop, gradle ]
branches: [ master, develop, java17 ]

jobs:
build:
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM adoptopenjdk/openjdk14:x86_64-debian-jdk-14.0.2_12
#FROM openjdk:8-jdk
ENV LAS2PEER_PORT=9011

# tmitocar dependencies (jq, ruby, coreutils)
FROM openjdk:17.0.1-jdk-buster
RUN apt-get update && apt-get install -y default-mysql-client ant jq build-essential libffi-dev ruby ruby-bundler dos2unix coreutils curl tzdata git gcc cmake libpng-dev graphviz wkhtmltopdf pandoc rsync poppler-utils

RUN git clone --recursive https://github.com/kornelski/pngquant.git
Expand Down Expand Up @@ -33,7 +30,8 @@ RUN dos2unix tmitocar/feedback.sh
RUN chmod +x /src/docker-entrypoint.sh
RUN dos2unix /src/docker-entrypoint.sh
RUN dos2unix /src/gradle.properties
RUN dos2unix gradlew
RUN chmod +x gradlew && ./gradlew build --exclude-task test

EXPOSE $LAS2PEER_PORT
ENTRYPOINT ["/src/docker-entrypoint.sh"]
ENTRYPOINT ["/src/docker-entrypoint.sh"]
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ set_in_service_config lrsAuthTokenDresden ${LRS_AUTH_TOKEN_DRESDEN}

# prevent glob expansion in lib/*
set -f
LAUNCH_COMMAND='java -cp lib/* i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}"
LAUNCH_COMMAND='java -cp lib/* --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}"
if [[ ! -z "${BOOTSTRAP}" ]]; then
LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}"
fi
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
core.version=1.1.2
core.version=1.2-SNAPSHOT
service.name=i5.las2peer.services.tmitocar
service.class=TmitocarService
service.version=1.0.0
java.version=14
java.version=17

las2peer_user1.name=alice
las2peer_user1.password=pwalice
Expand Down
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-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
31 changes: 21 additions & 10 deletions las2peer-tmitocar-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ plugins {

repositories {
// Use JCenter for resolving dependencies.
jcenter()
mavenCentral()

// DBIS Archiva
maven {
url "https://archiva.dbis.rwth-aachen.de:9911/repository/internal/"
}

maven {
url "https://archiva.dbis.rwth-aachen.de:9911/repository/snapshots/"
}
}

dependencies {
Expand All @@ -20,18 +24,18 @@ dependencies {

// las2peer bundle which is not necessary in the runtime path
// compileOnly will be moved into the lib dir afterwards
compileOnly "i5:las2peer-bundle:${project.property('core.version')}"
implementation "i5:las2peer-bundle:${project.property('core.version')}"

compileOnly "org.jacoco:org.jacoco.ant:0.8.5"
compileOnly "net.minidev:json-smart:1.3.1"
compileOnly "org.apache.pdfbox:pdfbox-ant:1.8.16"
implementation "org.jacoco:org.jacoco.ant:0.8.5"
implementation "net.minidev:json-smart:1.3.1"
implementation "org.apache.pdfbox:pdfbox-ant:1.8.16"

// javax.websocket-api;version="1.1", jslack;version="1.8.1", rocketchat-common;version="0.7.1, rocketchat-core;version="0.7.1, rocketchat-livechat;version="0.7.1"
}

configurations {
// This ensures las2peer is available in the tests, but won't be bundled
testCompile.extendsFrom compileOnly
testImplementation.extendsFrom implementation
}

jar {
Expand All @@ -55,14 +59,15 @@ application {
archivesBaseName = group

version = "${project.property('service.version')}"
mainClassName = "i5.las2peer.tools.L2pNodeLauncher"
mainClass.set("i5.las2peer.tools.L2pNodeLauncher")
sourceCompatibility = "${project.property('java.version')}"
targetCompatibility = "${project.property('java.version')}"
}

// put all .jar files into export/jars folder
tasks.withType(Jar) {
destinationDir = file("$projectDir/export/jars")
duplicatesStrategy = 'include'
destinationDirectory = file("$projectDir/export/jars")
}

javadoc {
Expand Down Expand Up @@ -110,20 +115,26 @@ build.dependsOn copyToLib

task startscripts {
new File("$rootDir/bin", "start_network.sh").text = """#!/bin/bash
# this script is autogenerated by 'gradle startscripts'
# it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh
java -cp "lib/*" i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive
java -cp "lib/*" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive
"""
new File("$rootDir/bin", "start_network.bat").text = """:: this script is autogenerated by 'gradle startscripts'
:: it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
:: pls execute it from the bin folder of your deployment by double-clicking on it
%~d0
cd %~p0
cd ..
set BASE=%CD%
set CLASSPATH="%BASE%/lib/*;"
java -cp %CLASSPATH% i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService('${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}') startWebConnector interactive
set ADD_OPENS=--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED
java -cp %CLASSPATH% %ADD_OPENS% i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService('${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}') startWebConnector interactive
pause
"""
}
Expand Down
Loading

0 comments on commit 13f2abf

Please sign in to comment.