import io.micronaut.docs.MicronautDocsResources buildscript { repositories { mavenLocal() maven { url "https://repo.grails.org/grails/core" } } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsVersion" classpath "org.grails:grails-docs:$grailsVersion" classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' classpath 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1' classpath "io.micronaut.docs:micronaut-docs-asciidoc-extensions:$micronautDocsVersion", { exclude group:"com.github.jengelman.gradle.plugins" } classpath "io.micronaut.docs:micronaut-docs-gradle-plugins:$micronautDocsVersion", { exclude group:"com.github.jengelman.gradle.plugins" } classpath 'com.adarshr:gradle-test-logger-plugin:2.0.0' } } repositories { mavenCentral() } group "ai.stainless" version projectVersion subprojects { Project subproject -> group "ai.stainless" version project.projectVersion repositories { mavenLocal() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://repo.grails.org/grails/core" } // Use jcenter for resolving dependencies. // You can declare any Maven/Ivy/file repository here. jcenter() } apply plugin: "groovy" apply plugin: "java" apply plugin: "maven-publish" apply plugin: "signing" sourceCompatibility = 11 targetCompatibility = 11 jar { manifest { attributes('Automatic-Module-Name': "${subproject.group}.${subproject.name}".replaceAll('[^\\w\\.\\$_]', "_")) attributes('Implementation-Version':project.projectVersion) attributes('Implementation-Title': 'Micronaut Jupyter') } } task sourcesJar(type: Jar) { from sourceSets.main.allJava archiveClassifier = 'sources' } task javadocJar(type: Jar) { from javadoc archiveClassifier = 'javadoc' } tasks.withType(Test) { jvmArgs '-Duser.country=US' jvmArgs '-Duser.language=en' testLogging { exceptionFormat = 'full' } afterSuite { System.out.print(".") System.out.flush() } reports.html.enabled = true } javadoc { if(JavaVersion.current().isJava9Compatible()) { options.addBooleanOption('html5', true) } } publishing { repositories { def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : '' def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : '' maven { name = "mavenCentral" url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" credentials { username = ossUser password = ossPass } } maven { name = "mavenCentralSnapshots" url = "https://oss.sonatype.org/content/repositories/snapshots/" credentials { username = ossUser password = ossPass } } } } signing { /* * To create this file, run: * ``` * $ gpg --armor --export-secret-key SHORT_ID >> SIGNING_GPG_KEY * ``` * Replace `SHORT_ID` with the id of your key (or the email associated with the key). * DO NOT COMMIT THIS FILE TO GIT! (Use `travis encrypt-file` instead.) */ File signingKeyFile = new File("$rootProject.projectDir/SIGNING_GPG_KEY") String signingKey = signingKeyFile.exists() ? signingKeyFile.text : "" def signingPassword = System.getenv("SIGNING_GPG_PASSWORD") ?: findProperty("signingPassword") ?: '' useInMemoryPgpKeys(signingKey, signingPassword) } task allDeps(type: DependencyReportTask) {} } // configure micronuat-docs apply from:"https://raw.githubusercontent.com/micronaut-projects/micronaut-docs/v$micronautDocsVersion/gradle/docs.gradle" // alter downloadDocResources task: // - Change resource tasks order to: // - prepareDocResources -> downloadDocResources -> copyLocalDocResources // - Download resources directly to build dir // (will overwrite common resources, and be overwritten by src resources) // - Also alter clean task to remove from build dir instead of src dir def commonGithubSlug = 'grails-common-build' def commonBranch = 'master' def docResourcesDir = "${buildDir}/resources/${commonGithubSlug}-${commonBranch}/src/main/resources" def resourceFolderPath = "$docResourcesDir" downloadDocResources.mustRunAfter prepareDocResources copyLocalDocResources.mustRunAfter downloadDocResources downloadDocResources { task -> resourceFolder = file(resourceFolderPath) resourceFolders = [ file("$resourceFolderPath/css"), file("$resourceFolderPath/css/highlight"), file("$resourceFolderPath/js"), file("$resourceFolderPath/img"), file("$resourceFolderPath/style") ] task.onlyIf { boolean existsLogo = new File("$resourceFolderPath/img/${MicronautDocsResources.LOGO}").exists() if (existsLogo) { println "Skipping download resources, logo already exists." } !existsLogo } } publishConfigurationReference { pageTemplate = file("$resourceFolderPath/style/page.html") } cleanDocResources { resourceFolders = [ file("$resourceFolderPath/css"), file("$resourceFolderPath/css/highlight"), file("$resourceFolderPath/js"), file("$resourceFolderPath/img"), file("$resourceFolderPath/style") ] } // run groovydoc on docs docs.dependsOn ':jupyter:groovydoc' task rsync { // define rsync command def rsyncCommand = "$rootProject.projectDir/rsync" // attempt to run command try { def p = "$rsyncCommand".execute() p.waitFor() println "Ran local rsync" } catch (e) { // ignore any errors, like the command not existing } } task build { dependsOn rsync } docs.dependsOn rsync