diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..16894ecf --- /dev/null +++ b/build.gradle @@ -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. + * + */ diff --git a/htmlSanityCheck-core/build.gradle b/htmlSanityCheck-core/build.gradle index dae2373a..cee2f415 100644 --- a/htmlSanityCheck-core/build.gradle +++ b/htmlSanityCheck-core/build.gradle @@ -1,11 +1,3 @@ -repositories { - jcenter() -// mavenCentral() -} - -apply plugin: 'java' -apply plugin: 'groovy' - dependencies { testImplementation( @@ -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' @@ -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}" -} \ No newline at end of file +} + + +// ========================================================= + +//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. + * + */ diff --git a/htmlSanityCheck-gradle-plugin/build.gradle b/htmlSanityCheck-gradle-plugin/build.gradle index c6dc556c..90f1f723 100755 --- a/htmlSanityCheck-gradle-plugin/build.gradle +++ b/htmlSanityCheck-gradle-plugin/build.gradle @@ -1,29 +1,4 @@ -// 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', @@ -31,83 +6,32 @@ dependencies { ) 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. diff --git a/settings.gradle b/settings.gradle index 014a608a..20289ce0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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' \ No newline at end of file