-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: streamline build and sort out dependencies
- This commit tries to sort out the dependency chains used, to enable further future decoupling. This will add a lot of exclusions to the POMs, but we can comment out the exclusions in the dependencies blocks if we think this is a problem. - Streamline the build with composition.
- Loading branch information
Showing
19 changed files
with
785 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,63 @@ | ||
io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository | ||
|
||
buildscript { | ||
repositories { | ||
maven { url "https://repo.grails.org/grails/core" } | ||
maven { url = 'https://repo.grails.org/grails/core' } | ||
} | ||
dependencies { | ||
classpath platform("org.grails:grails-bom:$grailsVersion") | ||
classpath "io.github.gradle-nexus:publish-plugin:2.0.0" | ||
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0' | ||
} | ||
} | ||
|
||
ext { | ||
isCiBuild = (System.getenv().get("CI") as Boolean) | ||
isSnapshot = project.projectVersion.endsWith('-SNAPSHOT') | ||
isCiBuild = System.getenv('CI') | ||
isSnapshot = projectVersion.endsWith('-SNAPSHOT') | ||
isReleaseVersion = !isSnapshot | ||
} | ||
|
||
group = "org.grails" | ||
version project.projectVersion | ||
group = 'org.grails' | ||
version = projectVersion | ||
|
||
apply plugin: 'java-library' | ||
apply plugin: 'idea' | ||
|
||
allprojects { prj -> | ||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
maven { url = 'https://repo.grails.org/grails/core' } | ||
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow) | ||
if (groovyVersion?.endsWith('-SNAPSHOT')) { | ||
if (findProperty('groovyVersion')?.endsWith('-SNAPSHOT')) { | ||
maven { | ||
name = 'ASF Snapshot repo' | ||
url = 'https://repository.apache.org/content/repositories/snapshots' | ||
} | ||
} | ||
|
||
if (System.getenv("GITHUB_MAVEN_PASSWORD") && !grailsVersion.endsWith('-SNAPSHOT')) { | ||
System.out.println("Adding Grails Core Repo for project: ${prj.name}") | ||
if (System.getenv('GITHUB_MAVEN_PASSWORD') && !grailsVersion.endsWith('-SNAPSHOT')) { | ||
System.out.println("Adding Grails Core Staging Repo for project: $name") | ||
maven { | ||
url = 'https://maven.pkg.github.com/grails/grails-core' | ||
credentials { | ||
username = 'DOES_NOT_MATTER' | ||
password = System.getenv("GITHUB_MAVEN_PASSWORD") | ||
password = System.getenv('GITHUB_MAVEN_PASSWORD') | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply plugin: 'groovy' | ||
} | ||
|
||
if (isReleaseVersion) { | ||
apply plugin: "io.github.gradle-nexus.publish-plugin" | ||
|
||
apply plugin: 'io.github.gradle-nexus.publish-plugin' | ||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
def ossUser = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatypeOssUsername') ?: '' | ||
def ossPass = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty('sonatypeOssPassword') ?: '' | ||
def ossStagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: project.findProperty('sonatypeOssStagingProfileId') ?: '' | ||
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") | ||
username = ossUser | ||
password = ossPass | ||
stagingProfileId = ossStagingProfileId | ||
nexusUrl = uri('https://s01.oss.sonatype.org/service/local') | ||
username = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatypeOssUsername') ?: '' | ||
password = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty('sonatypeOssPassword') ?: '' | ||
stagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: project.findProperty('sonatypeOssStagingProfileId') ?: '' | ||
} | ||
} | ||
transitionCheckOptions { | ||
maxRetries.set(60) | ||
delayBetween.set(java.time.Duration.ofMillis(4000)) | ||
} | ||
} | ||
|
||
//do not generate extra load on Nexus with new staging repository if signing fails | ||
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach { | ||
shouldRunAfter(tasks.withType(Sign)) | ||
tasks.withType(InitializeNexusStagingRepository).configureEach { | ||
shouldRunAfter = tasks.withType(Sign) | ||
} | ||
} | ||
|
||
apply from: rootProject.layout.projectDirectory.file('gradle/aggregate-groovydoc.gradle') | ||
apply from: layout.projectDirectory.file('gradle/documentation-config.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,43 @@ | ||
buildscript { | ||
repositories { | ||
maven { url "https://repo.grails.org/grails/core" } | ||
maven { url = 'https://repo.grails.org/grails/core' } | ||
} | ||
dependencies { | ||
classpath platform("org.grails:grails-bom:$grailsVersion") | ||
classpath "org.grails:grails-gradle-plugin" | ||
classpath 'org.grails:grails-gradle-plugin' | ||
} | ||
} | ||
|
||
plugins { | ||
id "war" | ||
id "com.bertramlabs.asset-pipeline" version "5.0.5" | ||
} | ||
|
||
apply plugin:"org.grails.grails-web" | ||
apply plugin:"org.grails.grails-gsp" | ||
apply plugin:"org.grails.grails-plugin" | ||
|
||
version '0.0.1' | ||
group 'org.sitemesh.grails.plugins.sitemesh3' | ||
version = '0.0.1' | ||
group = 'org.sitemesh.grails.plugins.sitemesh3' | ||
|
||
apply plugin:"org.grails.grails-web" | ||
apply plugin:"org.grails.grails-gsp" | ||
apply plugin: 'org.grails.grails-web' | ||
apply plugin: 'org.grails.grails-gsp' | ||
|
||
dependencies { | ||
// for testing purposes | ||
// implementation files('lib/sitemesh-3.1.0-SNAPSHOT.jar', 'lib/spring-boot-starter-sitemesh-3.1.0-SNAPSHOT-plain.jar') | ||
console "org.grails:grails-console" | ||
|
||
implementation "org.grails:grails-plugin-databinding" | ||
implementation "org.grails:grails-plugin-i18n" | ||
implementation "org.grails:grails-plugin-interceptors" | ||
implementation "org.grails:grails-plugin-rest" | ||
implementation "org.grails:grails-plugin-services" | ||
implementation "org.grails:grails-plugin-url-mappings" | ||
implementation "org.grails:grails-web-boot" | ||
implementation project(':grails-plugin-gsp') | ||
implementation project(':grails-plugin-sitemesh3') | ||
|
||
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails" | ||
runtimeOnly "com.h2database:h2" | ||
runtimeOnly "org.apache.tomcat:tomcat-jdbc" | ||
runtimeOnly "org.fusesource.jansi:jansi" | ||
runtimeOnly "org.grails.plugins:hibernate5" | ||
runtimeOnly "org.grails.plugins:scaffolding" | ||
runtimeOnly "org.grails:grails-core" | ||
runtimeOnly "org.grails:grails-logging" | ||
runtimeOnly "org.springframework.boot:spring-boot-autoconfigure" | ||
runtimeOnly "org.springframework.boot:spring-boot-starter-actuator" | ||
runtimeOnly "org.springframework.boot:spring-boot-starter-logging" | ||
runtimeOnly "org.springframework.boot:spring-boot-starter-tomcat" | ||
runtimeOnly "org.springframework.boot:spring-boot-starter-validation" | ||
|
||
runtimeOnly "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:$jstlVersion" | ||
runtimeOnly "org.glassfish.web:jakarta.servlet.jsp.jstl:$jstlVersion" | ||
runtimeOnly 'org.apache.tomcat.embed:tomcat-embed-jasper:10.1.0' // jsp example | ||
implementation platform("org.grails:grails-bom:$grailsVersion") | ||
|
||
testImplementation 'org.grails:grails-gorm-testing-support' | ||
testImplementation 'org.grails:grails-web-testing-support' | ||
testImplementation 'org.spockframework:spock-core' | ||
integrationTestImplementation testFixtures ("org.grails.plugins:geb") | ||
} | ||
|
||
tasks.withType(Test) { | ||
useJUnitPlatform() | ||
} | ||
|
||
assets { | ||
minifyJs = true | ||
minifyCss = true | ||
packagePlugin = true | ||
implementation project(':grails-plugin-sitemesh3') | ||
implementation 'org.grails:grails-core' | ||
implementation 'org.grails:grails-plugin-controllers' | ||
|
||
runtimeOnly project(':grails-plugin-gsp') | ||
runtimeOnly 'com.bertramlabs.plugins:asset-pipeline-grails' | ||
runtimeOnly 'org.grails:grails-plugin-url-mappings' | ||
runtimeOnly 'org.grails:grails-plugin-i18n' | ||
runtimeOnly 'org.springframework.boot:spring-boot-autoconfigure' | ||
runtimeOnly 'org.springframework.boot:spring-boot-starter-logging' | ||
runtimeOnly 'org.springframework.boot:spring-boot-starter-tomcat' | ||
|
||
// JSP support | ||
runtimeOnly 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api' | ||
runtimeOnly 'org.apache.tomcat.embed:tomcat-embed-jasper' | ||
runtimeOnly 'org.glassfish.web:jakarta.servlet.jsp.jstl' | ||
|
||
integrationTestImplementation testFixtures('org.grails.plugins:geb') | ||
integrationTestImplementation 'org.grails:grails-testing-support' | ||
} | ||
|
||
bootRun { | ||
String springProfilesActive = 'spring.profiles.active' | ||
systemProperty springProfilesActive, System.getProperty(springProfilesActive) | ||
} | ||
apply from: rootProject.layout.projectDirectory.file('gradle/java-config.gradle') | ||
apply from: rootProject.layout.projectDirectory.file('gradle/test-config.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
configurations.register('documentation') | ||
|
||
dependencies { | ||
documentation "org.apache.groovy:groovy-groovydoc:4.0.24" | ||
documentation "org.apache.groovy:groovy-ant:4.0.24" | ||
} | ||
|
||
tasks.register('cleanDocs', Delete) { | ||
group = 'documentation' | ||
delete(rootProject.layout.buildDirectory.dir('docs')) | ||
} | ||
|
||
tasks.register('groovydoc', Groovydoc) { | ||
group = 'documentation' | ||
description = 'Copies Groovy API Documentation for all supporting projects' | ||
Set<Project> groovyDocProjects = rootProject.subprojects.findAll { | ||
it.name != 'docs' && !it.name.startsWith('examples') | ||
} | ||
def groovydocClasspath = files(configurations.documentation + groovyDocProjects.configurations.compileClasspath) | ||
classpath = groovydocClasspath | ||
groovyClasspath = groovydocClasspath | ||
docTitle = "Groovy Server Pages (GSP) - ${project.name} - ${project.version}" | ||
access = GroovydocAccess.PRIVATE | ||
includeAuthor = true | ||
includeMainForScripts = false | ||
processScripts = false | ||
dependsOn = [tasks.named('cleanDocs')] + groovyDocProjects.collect { it.tasks.named('groovydoc') } | ||
destinationDir = project.layout.buildDirectory.dir('docs/api').get().asFile | ||
source = groovyDocProjects.sourceSets.main.groovy.srcDirs | ||
doLast { delete(rootProject.layout.buildDirectory.dir('tmp')) } | ||
} | ||
|
||
tasks.register('docs') { | ||
group = 'documentation' | ||
dependsOn(':groovydoc', 'docs:publishGuide') | ||
finalizedBy('copyGuide') | ||
} | ||
|
||
tasks.register('copyGuide', Copy) { | ||
group = 'documentation' | ||
from(project(':docs').tasks.named('publishGuide')) | ||
into rootProject.layout.buildDirectory.dir('docs') | ||
} |
Oops, something went wrong.