Skip to content

Commit

Permalink
WIP Refactor Maven publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Jan 24, 2024
1 parent 9085be3 commit 2e02943
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
25 changes: 1 addition & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,6 @@ allprojects {
}
}

subprojects {
test {
useJUnitPlatform()
}

ext {
publishVariant = { String variant ->
publishing {
publications {
maven(MavenPublication) {
from components[variant]

// We have to perform some fancy renaming to make the plugin GAV coordinates match with docToolchain
groupId = group
artifactId = "org.aim42.${project.name.replaceAll('-', '.')}"
version = version
}
}
}
}
}
}

configure(subprojects) {
apply plugin: 'java'
apply plugin: 'groovy'
Expand Down Expand Up @@ -106,7 +83,7 @@ configure(subprojects) {
// Groovy source files using CodeNarc and generates reports from these checks.
// apply plugin: 'codenarc'

project.ext.publishVariant('java')
// project.ext.publishVariant('java')
}

/*
Expand Down
12 changes: 11 additions & 1 deletion htmlSanityCheck-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id 'java-library'
}

dependencies {
implementation libs.slf4j.api
testImplementation libs.slf4j.nop
Expand All @@ -8,7 +12,13 @@ dependencies {
implementation 'org.codehaus.groovy:groovy-dateutil'
}

//apply plugin: 'groovy'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}

tasks.register('copyResourceImages', Copy) {
from('src/main/resources') {
Expand Down
17 changes: 16 additions & 1 deletion htmlSanityCheck-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
apply plugin: 'java-gradle-plugin'
//apply plugin: 'java-gradle-plugin'
plugins {
id 'java-gradle-plugin'
}

publishing {
publications {
maven(MavenPublication) {
from components.java
// We have to perform some fancy renaming to make the plugin GAV coordinates match with gradle plugin naming conventions
groupId = group
artifactId = "org.aim42.${project.name.replaceAll('-', '.')}"
version = version
}
}
}

dependencies {
testImplementation(
Expand Down

0 comments on commit 2e02943

Please sign in to comment.