diff --git a/build.gradle b/build.gradle index 3ec7268acb..0262b092d9 100644 --- a/build.gradle +++ b/build.gradle @@ -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') \ No newline at end of file +apply from: layout.projectDirectory.file('gradle/documentation-config.gradle') \ No newline at end of file diff --git a/docs/build.gradle b/docs/build.gradle index bd5034669d..b6c3b74897 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -2,34 +2,28 @@ import grails.doc.gradle.PublishGuide buildscript { repositories { - mavenLocal() - 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-docs" + classpath "org.grails:grails-docs:$grailsVersion" } } -version rootProject.version - apply plugin: 'groovy' -//TODO: PublishGuide should eventually ensure the build directory exists +// TODO: PublishGuide should eventually ensure the build directory exists tasks.register('docsBuild') { doFirst { project.layout.buildDirectory.get().asFile.mkdirs() } - // Do not cache this task since the directory must exist if publishGuide is going to run outputs.upToDateWhen { false } } tasks.register('publishGuide', PublishGuide) { - dependsOn 'docsBuild' - - group = JavaBasePlugin.DOCUMENTATION_GROUP + group = 'documentation' description = 'Generate Guide' + dependsOn('docsBuild') targetDir = project.layout.buildDirectory.dir('docs').get().asFile outputs.dir(targetDir) // ensure gradle understands what this task generates @@ -41,37 +35,35 @@ tasks.register('publishGuide', PublishGuide) { resourcesDir = project.file('src/main/docs/resources') properties = [ 'safe' : 'UNSAFE', // Make sure any asciidoc security is disabled - 'version' : project.version, + 'version' : projectVersion, 'title' : 'Groovy Server Pages (GSP)', 'subtitle' : 'GSP (Groovy Server Pages) - A server-side view rendering technology based on Groovy', - // TODO: The javaee documentation has not been updated to jakarata + // TODO: The javaee documentation has not been updated to jakarta 'javaee' : 'https://docs.oracle.com/javaee/7/api/', 'jakartaee' : 'https://jakarta.ee/specifications/platform/10/apidocs/', 'javase' : 'https://docs.oracle.com/en/java/javase/17/docs/api/index.html', - 'groovyapi' : "https://docs.groovy-lang.org/$groovyVersion/html/gapi/", - 'groovyjdk' : "https://docs.groovy-lang.org/$groovyVersion/html/groovy-jdk/", + 'groovyapi' : "https://docs.groovy-lang.org/latest/html/gapi/", + 'groovyjdk' : "https://docs.groovy-lang.org/latest/html/groovy-jdk/", 'grailsapi' : "https://docs.grails.org/$grailsVersion/api/", - 'grailsdocs' : "https://docs.grails.org/$grailsVersion/", - 'gormapi' : 'http://gorm.grails.org/latest/api/', + 'grailsdocs' : "https://docs.grails.org/$grailsVersion/", + 'gormapi' : 'https://gorm.grails.org/latest/api/', 'springapi' : 'https://docs.spring.io/spring/docs/current/javadoc-api/', 'commandLineRef': "https://docs.grails.org/$grailsVersion/ref/Command%20Line", 'controllersRef': "https://docs.grails.org/$grailsVersion/ref/Controllers" ] as Properties doLast { - File destination = project.layout.buildDirectory.file("docs/guide/index.html").get().asFile + File destination = project.layout.buildDirectory.file('docs/guide/index.html').get().asFile destination.delete() - project.layout.buildDirectory.file('docs/guide/single.html').get().asFile.renameTo(destination) project.layout.buildDirectory.file('docs/index.html').get().asFile.text = ''' - - -
- - - - -