Skip to content

Commit

Permalink
aim42#309 Cleanup and simplify the overall build
Browse files Browse the repository at this point in the history
Kudos to the TNG/JGiven project - learned a lot from their nice Gradle setup!
  • Loading branch information
ascheman committed Oct 21, 2023
1 parent 0373e7f commit 755e9d7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 76 deletions.
36 changes: 25 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
plugins {
id 'java'
id 'groovy'
// id "com.gradle.plugin-publish" version "0.14.0"
id 'maven-publish'
}

ext {
Expand Down Expand Up @@ -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')
}

/*
Expand Down
6 changes: 0 additions & 6 deletions config/buildScan.gradle

This file was deleted.

15 changes: 0 additions & 15 deletions config/publish-gradle-plugin.gradle

This file was deleted.

13 changes: 0 additions & 13 deletions config/publish-snapshot.gradle

This file was deleted.

8 changes: 0 additions & 8 deletions htmlSanityCheck-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -38,11 +35,6 @@ processResources {
println "after processResources config, version= ${project.version}"
}


// =========================================================

//apply from: '../config/buildScan.gradle'

/*
* Copyright Gernot Starke and aim42 contributors.
*
Expand Down
23 changes: 0 additions & 23 deletions htmlSanityCheck-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 755e9d7

Please sign in to comment.