diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f969aecfe81582de2b68820ebd2eff48197aba27 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +TAG := $(shell git describe --tags) + +dist: + sed -i "s/CHANGE_ME/${GITLAB_DEPLOY_TOKEN}/g" gradle.properties + sed -i "s/CHANGE_ME/${TAG}/g" build.gradle + gradlew publish \ No newline at end of file diff --git a/build.gradle b/build.gradle index f514c7eed9438a01d7acb20c34adbef71b39fa2b..2284c6008f6de11a9096cb64b30916d3d30401b2 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ buildscript { plugins { id 'java' + id 'maven-publish' id 'org.springframework.boot' version '3.0.4' id 'io.spring.dependency-management' version '1.1.0' id "io.freefair.lombok" version "8.0.0-rc2" @@ -16,6 +17,7 @@ apply plugin: 'com.palantir.java-format' group = 'edu.umd.dawn' sourceCompatibility = '17' +version = 'CHANGE_ME' repositories { mavenCentral() @@ -39,4 +41,25 @@ tasks.named('test') { configurations { all*.exclude module : 'spring-boot-starter-logging' +} + + +publishing { + publications { + library(MavenPublication) { + from components.java + } + } + repositories { + maven { + url "https://gitlab.com/api/v4/projects/28471/packages/maven" + credentials(HttpHeaderCredentials) { + name = "deploy-token" + value = gitlabDeployToken // the token is stored in ~/.gradle/gradle.properties + } + authentication { + header(HttpHeaderAuthentication) + } + } + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 6c8ce48f39340ffe6d72e7b4fd7f5fd79104725a..9c85ffcf6b4e18e73608f56c8ed01ea1bb74d1d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,6 @@ org.gradle.jvmargs=--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNN --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ No newline at end of file + --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + +gitlabDeployToken=CHANGE_ME \ No newline at end of file