-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
202 lines (178 loc) · 6.34 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
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