@@ -2,65 +2,36 @@ buildscript {
22 repositories {
33 maven { url " https://repo.grails.org/grails/core" }
44 jcenter()
5- maven { url ' http ://dl.bintray.com/vermeulen-mp/gradle-plugins' }
5+ maven { url ' https ://dl.bintray.com/vermeulen-mp/gradle-plugins' }
66 }
77 dependencies {
88 classpath " commons-io:commons-io:2.2"
9- classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2 "
9+ classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4 "
1010 classpath " com.netflix.nebula:gradle-extra-configurations-plugin:2.2.0"
1111 classpath " com.github.adrianbk:gradle-travisci-trigger-plugin:1.0.0"
12- classpath ' com.bmuschko:gradle-nexus-plugin:2.3 '
13- classpath " io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0 "
14- classpath " gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:1.0.0 "
12+ classpath " com.bmuschko:gradle-nexus-plugin:$g radleNexusPluginVersion "
13+ classpath " io.codearte.gradle.nexus:gradle-nexus-staging-plugin:$g radleNexusStagingPluginVersion "
14+ classpath " gradle.plugin.io.sdkman:gradle-sdkvendor-plugin:$g radleSdkVendorVersion "
1515 classpath " io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1"
16+ classpath " javax.xml.bind:jaxb-api:$jaxbVersion "
17+ classpath " com.sun.xml.bind:jaxb-impl:$jaxbVersion "
18+ classpath " org.codehaus.groovy.modules.http-builder:http-builder:0.7.1"
1619 }
1720}
1821
19- apply plugin : ' idea'
22+ import groovyx.net.http.RESTClient
23+ import static groovyx.net.http.ContentType.*
2024
25+ apply plugin : ' idea'
2126
2227ext {
28+ isJava8Compatible = org.gradle.api.JavaVersion . current(). isJava8Compatible()
2329 bintrayPublish = false
2430 // Sets release version
2531 grailsVersion = ' 3.3.10.BUILD-SNAPSHOT'
2632// grailsVersion = '3.3.9'
2733 isBuildSnapshot = grailsVersion. endsWith(" .BUILD-SNAPSHOT" )
2834 isTravisBuild = System . getenv(). get(" TRAVIS" ) == ' true'
29-
30- asyncVersion = ' 3.3.2'
31- gspVersion = ' 3.3.2'
32- legacyConvertersVersion = " 3.3.1"
33- testingSupportVersion = " 1.1.5"
34- datastoreVersion = " 6.1.12.RELEASE"
35- hibernate4Version = " 6.1.8.RELEASE"
36- antTraxVersion = " 1.7.1"
37- antVersion = " 1.9.7"
38- aspectjVersion = " 1.8.7" // use same version as org.springframework:spring-aspects uses
39- commonsCliVersion = " 1.2"
40- commonsIOVersion = " 2.2"
41- commonsLangVersion = " 2.6"
42- gdocEngineVersion = " 1.0.1"
43-
44- groovyVersion = System . getenv(' CI_GROOVY_VERSION' ) ?: " 2.4.17"
45- jansiVersion = " 1.14"
46- jlineVersion = " 2.12"
47- jnaVersion = " 4.2.2"
48- slf4jVersion = " 1.7.25"
49-
50- spockVersion = ' 1.1-groovy-2.4'
51- springBootVersion = " 1.5.21.RELEASE"
52- springLoadedVersion = " 1.2.8.RELEASE"
53- directoryWatcherVersion = " 0.5.1"
54- springLoadedCommonOptions = " -Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true"
55- springVersion = " 4.3.22.RELEASE"
56- junitVersion = " 4.12"
57- concurrentlinkedhashmapVersion = " 1.4.2"
58- cglibVersion = " 2.2.2"
59- objenesisVersion = " 1.4"
60- tomcatVersion = " 8.5.40"
61- tomcatLog4jVersion = " 8.5.2"
62- servletApiVersion = " 3.0.1"
63-
6435 dependencyVersions = [
6536 datastore : [
6637 version : datastoreVersion,
12495 ],
12596 ]
12697
127- isJava8Compatible = org.gradle.api.JavaVersion . current(). isJava8Compatible()
128-
12998 nexusUsername = System . getenv(" SONATYPE_USERNAME" ) ?: project. hasProperty(" sonatypeOssUsername" ) ? project. sonatypeOssUsername : ' '
13099 nexusPassword = System . getenv(" SONATYPE_PASSWORD" ) ?: project. hasProperty(" sonatypeOssPassword" ) ? project. sonatypeOssPassword : ' '
131100
@@ -178,6 +147,7 @@ allprojects {
178147 repositories {
179148 mavenLocal()
180149 maven { url " https://repo.grails.org/grails/core" }
150+ maven { url " https://oss.sonatype.org/content/repositories/snapshots/" }
181151 if (groovyVersion. endsWith(' -SNAPSHOT' )) {
182152 maven {
183153 name ' JFrog OSS snapshot repo'
@@ -192,6 +162,12 @@ allprojects {
192162 def cacheHours = isCiBuild ? 0 : 24
193163 cacheDynamicVersionsFor cacheHours, ' hours'
194164 cacheChangingModulesFor cacheHours, ' hours'
165+ eachDependency { DependencyResolveDetails details ->
166+ // specifying a fixed version for all libraries with 'org.gradle' group
167+ if (details. requested. group == ' org.codehaus.groovy' ) {
168+ details. useVersion groovyVersion
169+ }
170+ }
195171 }
196172 }
197173 }
@@ -216,10 +192,8 @@ allprojects {
216192
217193 }
218194
219- if (JavaVersion . current(). isJava8Compatible()) {
220- tasks. withType(Javadoc ) {
221- options. addStringOption(' Xdoclint:none' , ' -quiet' )
222- }
195+ tasks. withType(Javadoc ) {
196+ options. addStringOption(' Xdoclint:none' , ' -quiet' )
223197 }
224198}
225199
@@ -308,21 +282,26 @@ subprojects { project ->
308282 username = u
309283 password = p
310284 }
311- url " https://repo.grails.org/grails/libs-snapshots-local"
285+ if (isBuildSnapshot) {
286+ url " https://repo.grails.org/grails/libs-snapshots-local"
287+ } else {
288+ url " https://repo.grails.org/grails/libs-releases-local"
289+ }
290+
312291 }
313292 }
314293
294+ if (project. name == ' grails-dependencies' ) return
295+ if (project. name == ' grails-bom' ) return
296+
315297 publications {
316298 maven(MavenPublication ) {
317299 from components. java
318300
319- artifact sourcesJar {
320- classifier " sources"
301+ afterEvaluate {
302+ artifact source : sourcesJar, classifier : " sources"
303+ artifact source : javadocJar, classifier : " javadoc"
321304 }
322- artifact javadocJar {
323- classifier " javadoc"
324- }
325-
326305 pom. withXml {
327306 def xml = asNode()
328307
@@ -387,7 +366,7 @@ subprojects { project ->
387366 if (project. name =~ / ^(grails-plugin-datasource|grails-test-suite)/ ) {
388367 dependencies {
389368 provided ' hsqldb:hsqldb:1.8.0.10'
390- provided ' com.h2database:h2:1.3.176 '
369+ provided " com.h2database:h2:$h 2Version "
391370 }
392371 }
393372
@@ -428,18 +407,6 @@ subprojects { project ->
428407 options. docEncoding " UTF-8"
429408 options. charSet " UTF-8"
430409 options. jFlags " -Xms64M" , " -Xmx512M"
431- if (! isJava8Compatible) {
432- options. jFlags " -XX:MaxPermSize=256m"
433- }
434- }
435-
436- idea {
437- module. iml. whenMerged { module ->
438- // adding slf4j-simple with scope TEST to .iml
439- module. dependencies << new org.gradle.plugins.ide.idea.model.ModuleLibrary (
440- [new org.gradle.plugins.ide.idea.model.Path (" jar://\$ GRADLE_USER_HOME/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-${ slf4jVersion} .jar!/" )], [], [], [], " TEST"
441- )
442- }
443410 }
444411
445412 dependencies {
@@ -462,7 +429,7 @@ subprojects { project ->
462429
463430 // Testing
464431 testCompile " junit:junit:${ junitVersion} "
465-
432+ testCompile " org.slf4j:slf4j-simple: $s lf4jVersion "
466433 testCompile(" org.spockframework:spock-core:${ spockVersion} " ) {
467434 transitive = false
468435 exclude group :' junit' , module : ' junit-dep'
@@ -482,18 +449,12 @@ subprojects { project ->
482449 if (isTravisBuild) {
483450 maxParallelForks = 2
484451 maxHeapSize = ' 768m'
485- if (! isJava8Compatible) {
486- jvmArgs ' -XX:MaxPermSize=256m'
487- }
488452 afterSuite {
489453 System . out. print (' .' )
490454 System . out. flush()
491455 }
492456 } else {
493457 maxHeapSize = ' 1024m'
494- if (! isJava8Compatible) {
495- jvmArgs ' -XX:MaxPermSize=512m'
496- }
497458 }
498459 if (System . getProperty(" debug.tests" )) {
499460 jvmArgs debugArguments
@@ -507,7 +468,6 @@ subprojects { project ->
507468 }
508469 }
509470
510-
511471 configurations {
512472 meta
513473 published. extendsFrom archives, meta
@@ -516,17 +476,13 @@ subprojects { project ->
516476
517477 if (! isTestSuite) {
518478
519-
520-
521479 task installToHomeDist(type : Upload ) {
522480 configuration = configurations. archives
523481 repositories {
524482 flatDir name : ' libs' , dirs : distInstallDir
525483 }
526484 }
527485
528-
529-
530486 project. tasks. withType(org.gradle.api.publish.maven.tasks.PublishToMavenLocal ) { org.gradle.api.publish.maven.tasks.PublishToMavenLocal t ->
531487 t. dependsOn installToHomeDist
532488 t. doLast {
@@ -535,13 +491,9 @@ subprojects { project ->
535491 }
536492 }
537493 }
538-
539494 }
540-
541495}
542496
543-
544-
545497task clean (type : Delete ) {
546498 delete buildDir,
547499 homeBinDir,
@@ -551,8 +503,43 @@ task clean(type: Delete) {
551503 homeSrcDir
552504}
553505
506+ task synchronizeWithMavenCentral () {
507+ description = " Syncs with Maven Central/Sonatype"
508+ doLast {
509+ println """
510+ Synchronizing with Maven central. This may take a few minutes ...
511+ If this fails, log on to http://oss.sonatype.org/ using the centralUser credentials
512+ and progress through process manually -> Close -> Publish ... under staging repositories
513+ """
514+ try {
515+ // doesn't exist.. try sync
516+ def client = new RESTClient (' https://api.bintray.com/maven_central_sync/grails/grails-core/' )
517+ client. headers[' Authorization' ] = ' Basic ' + " $bintrayUser :$bintrayKey " . getBytes(' iso-8859-1' ). encodeBase64()
518+ def body = / {}/
519+ def resp = client. post(
520+ path : " grails-core/versions/$grailsVersion " ,
521+ body : body,
522+ requestContentType : JSON
523+ )
524+ assert resp. status == 200
525+ println resp. data. status
526+ println resp. data. messages. join(' \n ' )
527+ } catch (groovyx.net.http.HttpResponseException e) {
528+ println " Error: $e "
529+ println " Message: $e. message "
530+ println " Body: $e. response . data "
531+ throw e
532+ }
533+ }
534+ }
535+
554536// From this point on we need the subprojects to be fully configured, so force their full evaluation
555- subprojects. each { evaluationDependsOn it. path }
537+ subprojects. each {
538+ if (it. tasks. findByName(' install' ) && it. tasks. findByName(' publishToMavenLocal' )) {
539+ it. tasks. findByName(' install' ). finalizedBy(it. tasks. findByName(' publishToMavenLocal' ))
540+ }
541+ evaluationDependsOn it. path
542+ }
556543
557544apply {
558545 from ' gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs)
@@ -589,4 +576,4 @@ sdkman {
589576 version = project. version
590577 url = " https://github.com/grails/grails-core/releases/download/v${ project.version} /grails-${ project.version} .zip"
591578 hashtag = " #grailsfw"
592- }
579+ }
0 commit comments