| ext { |
| isCI = System.getenv('CI') != null |
| } |
| |
| String customGroovyVersion = findProperty('groovyVersion') ?: System.getenv('GROOVY_VERSION') |
| if (customGroovyVersion) { |
| logger.warn("Using custom Groovy version: $customGroovyVersion") |
| } |
| |
| allprojects { |
| |
| if (customGroovyVersion) { |
| configurations.configureEach { |
| resolutionStrategy.eachDependency { DependencyResolveDetails details -> |
| if (details.requested.group == 'org.apache.groovy') { |
| details.useVersion(customGroovyVersion) |
| } |
| } |
| } |
| } |
| |
| repositories { |
| // mavenLocal() |
| mavenCentral() |
| maven { |
| name = 'ASF Snapshot repo' |
| url = 'https://repository.apache.org/content/repositories/snapshots' |
| } |
| maven { url = 'https://repo.grails.org/grails/core' } |
| // mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow) |
| if (customGroovyVersion?.endsWith('-SNAPSHOT')) { |
| // Used for testing locally against the latest snapshot of Groovy |
| // Usage: ./gradlew build -P"groovyVersion=X.X.X-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") |
| maven { |
| url = 'https://maven.pkg.github.com/grails/grails-core' |
| credentials { |
| username = 'DOES_NOT_MATTER' |
| password = System.getenv("GITHUB_MAVEN_PASSWORD") |
| } |
| } |
| } |
| } |
| } |
| |
| tasks.register('clean', Delete) { |
| group = 'build' |
| delete layout.buildDirectory |
| } |
| |
| // Workaround needed for nexus publishing bug |
| // version and group must be specified in the root project |
| // https://github.com/gradle-nexus/publish-plugin/issues/310 |
| version = projectVersion |
| group = 'this.will.be.overridden' |
| |
| def publishedProjects = [ |
| 'views-core', |
| 'grails-gson', |
| 'grails-testing-support-views-gson', |
| 'grails-markup', |
| 'scaffolding', |
| 'fields-plugin', |
| 'grails-gsp-core', |
| 'grails-gsp', |
| 'grails-sitemesh3', |
| 'grails-taglib', |
| 'grails-web-gsp', |
| 'grails-web-gsp-taglib', |
| 'grails-web-jsp', |
| 'grails-web-taglib', |
| 'grails-testing-support-web' |
| ] |
| subprojects { |
| if (name in publishedProjects) { |
| // This has to be applied here |
| apply plugin: 'org.apache.grails.gradle.grails-publish' |
| } |
| } |