| buildscript { |
| repositories { |
| maven { url = 'https://repo.grails.org/grails/core' } |
| if (System.getenv("GITHUB_MAVEN_PASSWORD") && !grailsVersion.endsWith('-SNAPSHOT')) { |
| System.out.println("Adding Grails Core Repo for project ${project.name}") |
| maven { |
| url = 'https://maven.pkg.github.com/grails/grails-core' |
| credentials { |
| username = 'DOES_NOT_MATTER' |
| password = System.getenv("GITHUB_MAVEN_PASSWORD") |
| } |
| } |
| } |
| } |
| dependencies { |
| classpath "org.grails:grails-bom:${grailsVersion}" |
| classpath "org.grails:grails-gradle-plugin" |
| } |
| } |
| |
| plugins { |
| id 'com.github.ben-manes.versions' version '0.52.0' |
| } |
| |
| version = projectVersion |
| group = 'org.grails.plugins' |
| |
| apply plugin: 'java-library' |
| apply plugin: 'java-test-fixtures' |
| apply plugin: 'org.grails.grails-plugin' |
| apply plugin: 'org.grails.grails-publish' |
| |
| tasks.withType(JavaCompile).configureEach { |
| options.release = 17 |
| } |
| |
| repositories { |
| maven { url = 'https://repo.grails.org/grails/core' } |
| if (System.getenv("GITHUB_MAVEN_PASSWORD") && !grailsVersion.endsWith('-SNAPSHOT')) { |
| System.out.println("Adding Grails Core Repo for project ${project.name}") |
| maven { |
| url = 'https://maven.pkg.github.com/grails/grails-core' |
| credentials { |
| username = 'DOES_NOT_MATTER' |
| password = System.getenv("GITHUB_MAVEN_PASSWORD") |
| } |
| } |
| } |
| } |
| |
| configurations.register('documentation') |
| |
| ext.set('selenium.version', seleniumVersion) // Override selenium version from spring-boot-dependencies |
| |
| dependencies { |
| |
| implementation(platform("org.grails:grails-bom:$grailsVersion")) |
| |
| compileOnly 'org.grails:grails-core' // Provided, as this is a Grails plugin |
| |
| testFixturesCompileOnly 'jakarta.servlet:jakarta.servlet-api' |
| testFixturesCompileOnly 'org.slf4j:slf4j-simple' // Remove compilation warning about missing slf4j impl |
| |
| testFixturesApi 'org.gebish:geb-spock' |
| testFixturesApi 'org.grails:grails-testing-support' |
| testFixturesApi 'org.grails:grails-datastore-gorm' |
| testFixturesApi "org.testcontainers:selenium:$testcontainersVersion" |
| testFixturesApi "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" |
| testFixturesApi "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion" |
| |
| testFixturesImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" |
| |
| documentation 'org.apache.groovy:groovy' |
| documentation 'org.apache.groovy:groovy-ant' |
| documentation 'org.apache.groovy:groovy-templates' |
| documentation 'org.apache.groovy:groovy-xml' |
| documentation 'com.github.javaparser:javaparser-core' |
| |
| // Added to be able to resolve the geb version from the BOM in the resolveVersions task |
| compileOnly 'org.gebish:geb-spock' |
| } |
| |
| grailsPublish { |
| githubSlug = 'grails/geb' |
| license { |
| name = 'Apache-2.0' |
| } |
| title = 'Grails Geb Plugin' |
| desc = 'Provides Integration with Geb for Functional Testing' |
| developers = [ |
| graemerocher: 'Graeme Rocher', |
| puneetbehl: 'Puneet Behl', |
| sbglasius: 'Søren Berg Glasius', |
| matrei: 'Mattias Reichel', |
| jdaugherty: 'James Daugherty' |
| ] |
| } |
| |
| tasks.register('resolvedVersions') { |
| group = 'documentation' |
| description = 'Resolve Geb Version from the BOM' |
| ext.gebVersion = configurations.compileClasspath |
| .resolvedConfiguration |
| .resolvedArtifacts |
| .find { |
| it.moduleVersion.id.group == 'org.gebish' && |
| it.moduleVersion.id.name == 'geb-spock' |
| }.moduleVersion.id.version |
| logger.lifecycle('Resolved Geb version for Javadoc links: {}', gebVersion) |
| } |
| |
| tasks.withType(Groovydoc).configureEach { |
| destinationDir = layout.buildDirectory.dir('docs/api').get().asFile |
| docTitle = "Grails Geb Plugin $version" |
| classpath = configurations.documentation |
| source = files(source, sourceSets.testFixtures.allSource) |
| link("https://www.gebish.org/manual/${resolvedVersions.gebVersion}/api/", 'geb') |
| } |
| |
| tasks.withType(Test).configureEach { |
| useJUnitPlatform() |
| testLogging { |
| events('passed', 'skipped', 'failed') |
| showExceptions = true |
| exceptionFormat = 'full' |
| showCauses = true |
| showStackTraces = true |
| } |
| } |
| |
| tasks.withType(GroovyCompile).configureEach { |
| // Preserve method parameter names in Groovy classes for IDE parameter hints. |
| groovyOptions.parameters = true |
| } |
| |
| tasks.named('bootRun') { enabled = false } |
| tasks.named('bootTestRun') { enabled = false } |
| tasks.named('findMainClass') { enabled = false } |