Skip to content

Commit

Permalink
# configured maven-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
sbra0902 committed Dec 7, 2023
1 parent b41241f commit e6e36c1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 113 deletions.
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

buildscript {
ext.kotlin_version = '1.9.21'
ext.groupName = 'com.github.SchwarzIT'
repositories {
google()
mavenCentral()
Expand Down Expand Up @@ -41,10 +42,21 @@ subprojects {

}

def versionName() {

if (!hasProperty("version")) {
// don't care
return "dummy"
}

return property("version")
}


allprojects {
version = "dummy"
group = 'com.schwarz.crystal-map'
version = versionName()
group = groupName

repositories {
google()
mavenCentral()
Expand Down
42 changes: 7 additions & 35 deletions crystal-map-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'java'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
Expand All @@ -8,14 +9,12 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
java {
withSourcesJar()
withJavadocJar()
}

publishing {
Expand All @@ -27,31 +26,4 @@ publishing {
from components.java
}
}
}

artifacts {
archives sourcesJar
archives javadocJar
}
buildscript {
ext.kotlin_version = '1.9.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}
}
29 changes: 2 additions & 27 deletions crystal-map-couchbase-connector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ apply plugin: 'kotlin-android'

android {
namespace "com.schwarz.crystalcouchbaseconnector"
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
compileSdk = 33
versionCode 1
versionName "1.0"

Expand All @@ -28,38 +28,13 @@ android {
}
}

group = 'com.github.SchwarzIT'

task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

task classesJar(type: Jar) {
from "$buildDir/intermediates/classes/release"
}

artifacts {
archives classesJar
archives javadocJar
archives sourcesJar
}

afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId project.group
groupId groupName
artifactId project.name
version project.version
from components.release
Expand Down
28 changes: 4 additions & 24 deletions crystal-map-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'pmd'
apply plugin: 'kotlin-kapt'
apply plugin: 'java'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
Expand All @@ -26,14 +27,9 @@ dependencies {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
java {
withSourcesJar()
withJavadocJar()
}

publishing {
Expand Down Expand Up @@ -66,21 +62,5 @@ jacocoTestReport {
}
}

artifacts {
archives sourcesJar
archives javadocJar
}

compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}



30 changes: 5 additions & 25 deletions crystal-map-versioning-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,14 @@ gradlePlugin {
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17

artifacts {
archives sourcesJar
archives javadocJar
java {
withSourcesJar()
withJavadocJar()
}

repositories {
mavenCentral()
}
compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
}

publishing {
publications {
Expand Down

0 comments on commit e6e36c1

Please sign in to comment.