Skip to content

Commit

Permalink
aim42#309 Enable local build + test - drop publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Dec 13, 2023
1 parent 00b89c1 commit e1e6048
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 92 deletions.
100 changes: 100 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// gradle build script for htmlSanityCheck
// =======================================

buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}

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

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

allprojects {
group = 'org.aim42.htmlSanityCheck'
version = version

repositories {
mavenLocal()
mavenCentral()
}

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
}
}
}

subprojects {
// publishing {
// publications {
// maven(MavenPublication) {
// from components.java
// name project.name
// }
// }
// }
}

configure(subprojects) {
apply plugin: 'java'
// apply plugin: 'maven-publish'

// 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'
}

/*
* Copyright Gernot Starke and aim42 contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
49 changes: 40 additions & 9 deletions htmlSanityCheck-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
repositories {
jcenter()
// mavenCentral()
}

apply plugin: 'java'
apply plugin: 'groovy'

dependencies {

testImplementation(
Expand All @@ -25,6 +17,11 @@ dependencies {
implementation 'org.codehaus.groovy:groovy-dateutil:3.0.17'
}

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 @@ -39,4 +36,38 @@ processResources {
inputs.property "version", project.version
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [version: project.version])
println "after processResources config, version= ${project.version}"
}
}


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

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

/*
* Copyright Gernot Starke and aim42 contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
86 changes: 5 additions & 81 deletions htmlSanityCheck-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,113 +1,37 @@
// gradle build script for htmlSanityCheck
// =======================================


buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}

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

repositories {
jcenter()
// mavenCentral()
}

dependencies {

testImplementation(
'junit:junit:4.12',
'org.spockframework:spock-core:2.3-groovy-3.0',
gradleTestKit()
)

implementation group: 'org.jsoup', name: 'jsoup', version: '1.16.1'

implementation gradleApi()

implementation project(":htmlSanityCheck-core")
} // 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-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'

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

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


// end:BuildPlugins[]


// ==========================================================
// 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
}

}
}

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

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

apply from: '../config/publish-gradle-plugin.gradle'


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
}
}
//apply from: '../config/buildScan.gradle'
//
//apply from: '../config/publish-gradle-plugin.gradle'

/*
* Copyright Gernot Starke and aim42 contributors.
Expand Down
11 changes: 9 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}

plugins {
// to report build results back to gradle.org
id "com.gradle.enterprise" version "3.5.1"
id "com.gradle.enterprise" version "3.15.1"
}

rootProject.name = 'htmlSanityCheck'
rootProject.name = 'org.aim42.htmlSanityCheck'

include 'htmlSanityCheck-core',
'htmlSanityCheck-gradle-plugin'

0 comments on commit e1e6048

Please sign in to comment.