diff --git a/build.gradle b/build.gradle index 16894ecf..846a9dfa 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { plugins { id 'java' id 'groovy' -// id "com.gradle.plugin-publish" version "0.14.0" + id 'maven-publish' } ext { @@ -50,24 +50,38 @@ allprojects { } subprojects { -// publishing { -// publications { -// maven(MavenPublication) { -// from components.java -// name project.name -// } -// } -// } + 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: 'maven-publish' + apply plugin: 'groovy' + apply plugin: 'maven-publish' + + description "${rootProject.description} - Module ${project.name}" + + java // The CodeNarc plugin performs quality checks on your project’s // Groovy source files using CodeNarc and generates reports from these checks. // apply plugin: 'codenarc' - //apply from: 'config/codenarc.gradle' + + project.ext.publishVariant('java') } /* diff --git a/config/buildScan.gradle b/config/buildScan.gradle deleted file mode 100644 index f515e3c5..00000000 --- a/config/buildScan.gradle +++ /dev/null @@ -1,6 +0,0 @@ -buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' - - //publishAlways() -} diff --git a/config/publish-gradle-plugin.gradle b/config/publish-gradle-plugin.gradle deleted file mode 100644 index c941a13c..00000000 --- a/config/publish-gradle-plugin.gradle +++ /dev/null @@ -1,15 +0,0 @@ - -pluginBundle { - website = 'https://github.com/aim42/htmlSanityCheck' - vcsUrl = 'https://github.com/aim42/htmlSanityCheck' - description = 'Checks HTML files for broken links, missing images etc.' - tags = ['checks', 'quality', 'documentation', 'html', 'asciidoctor', 'test'] - - plugins { - htmlSanityCheck { - id = 'org.aim42.htmlSanityCheck' - displayName = 'htmlSanityCheck plugin' - - } - } -} diff --git a/config/publish-snapshot.gradle b/config/publish-snapshot.gradle deleted file mode 100644 index 41eeb371..00000000 --- a/config/publish-snapshot.gradle +++ /dev/null @@ -1,13 +0,0 @@ -// Allow publishing builds to an S3 bucket for testing in other projects -publishing { - repositories { - maven { - // AWS_S3_URL = s3://bucketid/ - url System.getenv('AWS_S3_URL') - credentials(AwsCredentials) { - accessKey System.getenv('AWS_ACCESS_KEY_ID') - secretKey System.getenv('AWS_SECRET_ACCESS_KEY') - } - } - } -} diff --git a/htmlSanityCheck-core/build.gradle b/htmlSanityCheck-core/build.gradle index cee2f415..3c15b21f 100644 --- a/htmlSanityCheck-core/build.gradle +++ b/htmlSanityCheck-core/build.gradle @@ -19,9 +19,6 @@ dependencies { apply plugin: 'groovy' -// publish to (local) maven repo -//apply from: "../config/publish-snapshot.gradle" - task copyResourceImages(type: Copy) { from('src/main/resources') { include '**/*.png' @@ -38,11 +35,6 @@ processResources { println "after processResources config, version= ${project.version}" } - -// ========================================================= - -//apply from: '../config/buildScan.gradle' - /* * Copyright Gernot Starke and aim42 contributors. * diff --git a/htmlSanityCheck-gradle-plugin/build.gradle b/htmlSanityCheck-gradle-plugin/build.gradle index 90f1f723..6b52b01b 100755 --- a/htmlSanityCheck-gradle-plugin/build.gradle +++ b/htmlSanityCheck-gradle-plugin/build.gradle @@ -10,29 +10,6 @@ dependencies { implementation project(":htmlSanityCheck-core") } -// tag::BuildPlugins[] - -apply plugin: 'java-gradle-plugin' - -// publish to gradle-plugin-repository -//apply plugin: "com.gradle.plugin-publish" - -// publish to (local) maven repo -//apply from: "../config/publish-snapshot.gradle" - - -// end:BuildPlugins[] - -// ========================================================== -// if you use htmlSanityCheck locally, publish with -// "gradle publishToMavenLocal" - -// ========================================================= - -//apply from: '../config/buildScan.gradle' -// -//apply from: '../config/publish-gradle-plugin.gradle' - /* * Copyright Gernot Starke and aim42 contributors. * diff --git a/settings.gradle b/settings.gradle index 20289ce0..c29d5cd9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,6 +10,14 @@ plugins { id "com.gradle.enterprise" version "3.15.1" } +gradleEnterprise { + buildScan { + termsOfServiceUrl = 'https://gradle.com/terms-of-service' + termsOfServiceAgree = 'yes' + } +} + + rootProject.name = 'org.aim42.htmlSanityCheck' include 'htmlSanityCheck-core',