From 575ed10b76d84a89f087af9dbadfb27d8b4d20b5 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Wed, 12 Jun 2024 07:30:12 +0200 Subject: [PATCH] Jitpack publish libCore --- IOIOLibCore/build.gradle | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/IOIOLibCore/build.gradle b/IOIOLibCore/build.gradle index e505ccca..addfb173 100644 --- a/IOIOLibCore/build.gradle +++ b/IOIOLibCore/build.gradle @@ -1,6 +1,9 @@ -apply plugin: 'java' +plugins { + id 'java' + id 'maven-publish' +} -task generateVersionFile(type: GenerateVersion) { +tasks.register('generateVersionFile', GenerateVersion) { version = versionString outputFile = file("$project.buildDir/classes/main/version.properties") } @@ -12,12 +15,12 @@ javadoc { failOnError = false } -task javadocJar(type: Jar) { +tasks.register('javadocJar', Jar) { archiveClassifier = 'javadoc' from javadoc } -task sourcesJar(type: Jar) { +tasks.register('sourcesJar', Jar) { archiveClassifier = 'sources' from sourceSets.main.allSource } @@ -41,3 +44,18 @@ class GenerateVersion extends DefaultTask { properties.store(file.newWriter(), null) } } + +publishing { + publications { + release(MavenPublication) { + afterEvaluate { + from components.findByName('release') + } + } + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +}