Skip to content

Commit

Permalink
🔀 Merge pull request #310 from ascheman/feature/modularize
Browse files Browse the repository at this point in the history
Start modularization according to #309
  • Loading branch information
ascheman authored Dec 13, 2023
2 parents fa8b073 + 55a6de1 commit b5f78f6
Show file tree
Hide file tree
Showing 125 changed files with 1,532 additions and 742 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ src/docs/excel
src/docs/website/_site
lib
src/docs/resources/graphics/.DS_Store
/.sdkmanrc
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= image:./htmlsanitycheck-logo.png[Html-SC] Html Sanity Check
:version: 1.1.5
:version: 2.0.0

:plugin-url: https://github.com/aim42/htmlSanityCheck
:plugin-issues: https://github.com/aim42/htmlSanityCheck/issues
Expand Down
154 changes: 53 additions & 101 deletions build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// gradle build script for htmlSanityCheck
// =======================================


buildscript {
repositories {
jcenter()
Expand All @@ -12,128 +11,81 @@ buildscript {
}

plugins {
id 'groovy'
id 'java'
id "com.gradle.plugin-publish" version "0.14.0"
}

repositories {
jcenter()
// mavenCentral()
id 'groovy'
id 'maven-publish'
}

dependencies {

testImplementation(
'junit:junit:4.12',
'org.spockframework:spock-core:1.3-groovy-2.5')

implementation gradleApi()

implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'

// since gradle 4.6, annotation processors shall be explicitly declared
// (instead of just having them in the compile-group)
annotationProcessor 'org.apache.logging.log4j:log4j-core:2.17.1'


// jsoup is our awesome html parser, see jsoup.org
implementation group: 'org.jsoup', name: 'jsoup', version: '1.16.1'


} // dependencies


group = 'org.aim42'


ext {
srcDir = "$projectDir/src/docs"
javaVersion = System.getProperty("java.version")
currentDate = new Date().format("d. MMM yyyy")
}

// tag::BuildPlugins[]
apply plugin: 'groovy'
apply plugin: 'java'

apply plugin: 'java-gradle-plugin'

// 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'
allprojects {
group = 'org.aim42.htmlSanityCheck'
version = version

// publish to gradle-plugin-repository
apply plugin: "com.gradle.plugin-publish"

// publish to (local) maven repo
apply plugin: 'maven-publish'
apply from: "config/publish-snapshot.gradle"


// end:BuildPlugins[]


task copyResourceImages(type: Copy) {
from('src/main/resources') {
include '**/*.png'
repositories {
mavenLocal()
mavenCentral()
}
into processResources.destinationDir
}

processResources {
exclude '**/*.png'
inputs.property "version", project.version
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [version: project.version])
dependsOn copyResourceImages
println "after processResources config, version= ${project.version}"
task info(
description: "info on path and objects"
) {
doLast
{
println "project.name : " + project.name
println "version : " + version
println "project.version : " + project.version
println "project.path : " + project.path
println "projectDir : " + projectDir
println "groupId : " + project.group
println "buildDir : " + buildDir
println "targetCompatibility : " + java.targetCompatibility
println "=" * 80
}
}
}

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




// ==========================================================
// if you use htmlSanityCheck locally, publish with
// "gradle publishToMavenLocal"


publishing {
publications {
mavenJava(MavenPublication) {
groupId 'org.aim42'
artifactId project.name
version project.version
from components.java
subprojects {
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'
apply plugin: 'maven-publish'

apply from: 'config/buildScan.gradle'
description "${rootProject.description} - Module ${project.name}"

apply from: 'config/publish-gradle-plugin.gradle'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}

// The CodeNarc plugin performs quality checks on your project’s
// Groovy source files using CodeNarc and generates reports from these checks.
// apply plugin: 'codenarc'

task info(
description: "info on path and objects"
) {
doLast
{
println "project.name : " + project.name
println "version : " + version
println "project.version : " + project.version
println "project.path : " + project.path
println "projectDir : " + projectDir
println "groupId : " + project.group
println "buildDir : " + buildDir
println "targetCompatibility : " + rootProject.targetCompatibility
println "=" * 80
}
project.ext.publishVariant('java')
}

/*
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
HtmlSanityCheck - ChangeLog

v 2.0.0
October 2023: GA/BK/JT, modularize htmlSanityChecker -> gradle plugin + core (+ CLI)

v 1.1.5
April 2021: GS, compiled with Java 8 - as I accidentally compiled V 1.1.4 with jdk 14...
no other changes or fixes
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.

Loading

0 comments on commit b5f78f6

Please sign in to comment.