Skip to content
Snippets Groups Projects
Commit 4f759b53 authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge branch 'feature/package-submodule' into 'main'

Feature/package submodule

See merge request !2
parents 211134b4 47359926
No related branches found
No related tags found
1 merge request!2Feature/package submodule
Pipeline #13142 passed
...@@ -6,11 +6,9 @@ stages: ...@@ -6,11 +6,9 @@ stages:
- test - test
build: build:
image: openjdk:8 image: openjdk:11
stage: build stage: build
script: script:
# see discussion in the answer of https://stackoverflow.com/questions/44911155/gradle-how-to-include-runtimeonly-dependencies-in-javaexec-classpath
- ./gradlew --console=plain --no-daemon relast.preprocessor:jar
- ./gradlew --console=plain --no-daemon assemble jar - ./gradlew --console=plain --no-daemon assemble jar
artifacts: artifacts:
paths: paths:
...@@ -18,7 +16,7 @@ build: ...@@ -18,7 +16,7 @@ build:
test: test:
image: openjdk:8 image: openjdk:11
stage: test stage: test
script: script:
- ./gradlew --console=plain --no-daemon check - ./gradlew --console=plain --no-daemon check
......
[submodule "relast.preprocessor"]
path = relast.preprocessor
url = ../../relast-preprocessor.git
...@@ -14,11 +14,20 @@ application.mainClassName = "${mainClassName}" ...@@ -14,11 +14,20 @@ application.mainClassName = "${mainClassName}"
repositories { repositories {
mavenCentral() mavenCentral()
maven {
name 'gitlab-maven'
url 'https://git-st.inf.tu-dresden.de/api/v4/groups/jastadd/-/packages/maven'
}
}
configurations {
relast
} }
dependencies { dependencies {
implementation project(':relast.preprocessor') relast group: 'org.jastadd', name: 'relast', version: "${relast_version}"
testImplementation testFixtures(project(":relast.preprocessor")) implementation group: 'org.jastadd', name: 'relast-preprocessor', version: "${preprocessor_version}"
testImplementation testFixtures(group: 'org.jastadd', name: 'relast-preprocessor', version: "${preprocessor_version}")
} }
project.version = "0.2.0" project.version = "0.2.0"
...@@ -35,20 +44,37 @@ test { ...@@ -35,20 +44,37 @@ test {
maxHeapSize = '1G' maxHeapSize = '1G'
} }
task extractJastAddSources(type: Sync) {
dependsOn configurations.runtimeClasspath
configurations.runtimeClasspath.asFileTree.filter { it.toString().endsWith("relast-preprocessor-${preprocessor_version}.jar") }.collect {
from(zipTree(it)) {
include "**/*.jrag"
include "**/*.jadd"
include "**/*.ast"
include "**/*.relast"
include "**/*.flex"
include "**/*.parser"
}
}
includeEmptyDirs false
into file("${project.buildDir}/tmp/jastadd-sources")
}
jar { jar {
manifest { manifest {
attributes "Main-Class": "${mainClassName}" attributes "Main-Class": "${mainClassName}"
} }
from { from {
configurations.runtimeClasspath.collect { return (it.exists() && (!it.toString().contains("/build/libs/")|| it.toString().contains("-base-"))) ? (it.isDirectory() ? it : zipTree(it)) : null } configurations.runtimeClasspath.collect {it.isDirectory() ? it : zipTree(it) }
} }
} }
// Input and output files for relast // Input and output files for relast
def relastInputFiles = [ def relastInputFiles = [
"relast.preprocessor/src/main/jastadd/RelAst.relast", "${project.buildDir}/tmp/jastadd-sources/RelAst.relast",
"relast.preprocessor/src/main/jastadd/mustache/Mustache.relast" "${project.buildDir}/tmp/jastadd-sources/mustache/Mustache.relast"
] ]
def relastOutputFiles = [ def relastOutputFiles = [
"src/gen/jastadd/RelAst.ast", "src/gen/jastadd/RelAst.ast",
...@@ -59,8 +85,11 @@ def relastOutputFiles = [ ...@@ -59,8 +85,11 @@ def relastOutputFiles = [
task relast(type: JavaExec) { task relast(type: JavaExec) {
classpath = files("relast.preprocessor/libs/relast.jar")
group = 'Build' group = 'Build'
classpath = configurations.relast
mainClass = 'org.jastadd.relast.compiler.Compiler'
dependsOn extractJastAddSources
doFirst { doFirst {
delete relastOutputFiles delete relastOutputFiles
...@@ -88,9 +117,9 @@ jastadd { ...@@ -88,9 +117,9 @@ jastadd {
jastadd { jastadd {
basedir "." basedir "."
include "relast.preprocessor/src/main/jastadd/**/*.ast" include "build/tmp/jastadd-sources/**/*.ast"
include "relast.preprocessor/src/main/jastadd/**/*.jadd" include "build/tmp/jastadd-sources/**/*.jadd"
include "relast.preprocessor/src/main/jastadd/**/*.jrag" include "build/tmp/jastadd-sources/**/*.jrag"
include "src/main/jastadd/**/*.ast" include "src/main/jastadd/**/*.ast"
include "src/main/jastadd/**/*.jadd" include "src/main/jastadd/**/*.jadd"
include "src/main/jastadd/**/*.jrag" include "src/main/jastadd/**/*.jrag"
...@@ -100,18 +129,18 @@ jastadd { ...@@ -100,18 +129,18 @@ jastadd {
} }
scanner { scanner {
include "relast.preprocessor/src/main/jastadd/scanner/Header.flex", [-4] include "build/tmp/jastadd-sources/scanner/Header.flex", [-4]
include "relast.preprocessor/src/main/jastadd/scanner/Preamble.flex", [-3] include "build/tmp/jastadd-sources/scanner/Preamble.flex", [-3]
include "relast.preprocessor/src/main/jastadd/scanner/Macros.flex", [-2] include "build/tmp/jastadd-sources/scanner/Macros.flex", [-2]
include "relast.preprocessor/src/main/jastadd/scanner/RulesPreamble.flex", [-1] include "build/tmp/jastadd-sources/scanner/RulesPreamble.flex", [-1]
include "relast.preprocessor/src/main/jastadd/scanner/Keywords.flex", [ 0] include "build/tmp/jastadd-sources/scanner/Keywords.flex", [ 0]
include "relast.preprocessor/src/main/jastadd/scanner/Symbols.flex", [ 1] include "build/tmp/jastadd-sources/scanner/Symbols.flex", [ 1]
include "relast.preprocessor/src/main/jastadd/scanner/RulesPostamble.flex", [ 2] include "build/tmp/jastadd-sources/scanner/RulesPostamble.flex", [ 2]
} }
parser { parser {
include "relast.preprocessor/src/main/jastadd/parser/Preamble.parser" include "build/tmp/jastadd-sources/parser/Preamble.parser"
include "relast.preprocessor/src/main/jastadd/parser/RelAst.parser" include "build/tmp/jastadd-sources/parser/RelAst.parser"
} }
} }
} }
...@@ -142,5 +171,4 @@ jastadd { ...@@ -142,5 +171,4 @@ jastadd {
} }
clean.dependsOn(cleanGen) clean.dependsOn(cleanGen)
generateAst.dependsOn(relast) generateAst.dependsOn(relast, extractJastAddSources)
jar.dependsOn("relast.preprocessor:jar") // the jar is a fat jar that contains the jar of the preprocessor
relast_version = 0.3.0-137
preprocessor_version = 0.1.0-41
\ No newline at end of file
No preview for this file type
#Sun Nov 01 15:07:09 CET 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
...@@ -82,6 +82,7 @@ esac ...@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
...@@ -129,6 +130,7 @@ fi ...@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
......
...@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. ...@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
...@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome ...@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
...@@ -51,7 +54,7 @@ goto fail ...@@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
...@@ -61,28 +64,14 @@ echo location of your Java installation. ...@@ -61,28 +64,14 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
......
Subproject commit cee30f5c8a1b356118f5ed78302a1df64fe76897
- name: "RelAST Preprocessor Grammar from submodule (null)" - name: "RelAST Preprocessor Grammar from submodule (null)"
in: "../../../../relast.preprocessor/src/main/jastadd/" in: "../../../../build/tmp/jastadd-sources/"
args: args:
- "--inputBaseDir=../../../../relast.preprocessor/src/main/jastadd/" - "--inputBaseDir=../../../../build/tmp/jastadd-sources/"
- "--outputBaseDir=out" - "--outputBaseDir=out"
- "--errorHandling=null" - "--errorHandling=null"
- "RelAst.relast" - "RelAst.relast"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment