-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
159 lines (142 loc) · 5.27 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
/*
* Copyright 2019 Sme.UP S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
//-----------------
//Main build script
//-----------------
buildscript {
repositories {
mavenCentral()
maven {
name 'JFrog OSS snapshot repo'
url 'https://oss.jfrog.org/oss-snapshot-local/'
}
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jlleitschuh.gradle:ktlint-gradle:8.2.0"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
}
}
plugins {
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id "org.ajoberstar.grgit" version "5.3.0"
}
project.group = jarikoGroupId
project.version = jarikoVersion
subprojects {
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.jlleitschuh.gradle.ktlint'
apply plugin: 'kotlinx-serialization'
apply plugin: 'signing'
apply plugin: 'maven-publish'
repositories {
mavenLocal()
mavenCentral()
maven {
name 'Smeup Nexus'
url 'https://repo.smeup.cloud/nexus/repository/public/'
}
maven { url 'https://jitpack.io' }
// the sonatype repo inclusion allows to work with the reload snapshot version
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://oss.jfrog.org/oss-snapshot-local/' }
jcenter()
}
// project.group and project.version are used to identify jariko maven coordinates
// If you have a project depending on jariko and you want to test
// some jariko feature without waiting for jitpack.io, you can type:
// ./gradlew install
// This task will install jariko artifacts into your local maven repository
project.group = jarikoGroupId
project.version = jarikoVersion
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
}
}
}
}
nexusPublishing {
// trick to bypass staging when we publishToSmeup, because smeup nexus does not support the staging features
// however take in account that this flag in the other cases must be true or false depending on the version name
useStaging = !(project.gradle.startParameter.taskNames.contains("publishToSmeup") || jarikoVersion.endsWith("SNAPSHOT"))
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = findProperty("sonatypeUsername")
password = findProperty("sonatypePassword")
}
smeup {
nexusUrl = uri("https://repo.smeup.cloud/nexus/content/repositories/releases/")
//when useStaging=false it is always used snapshotRepositoryUrl
snapshotRepositoryUrl = jarikoVersion.endsWith("SNAPSHOT") ?
uri("https://repo.smeup.cloud/nexus/content/repositories/snapshots/"):
uri("https://repo.smeup.cloud/nexus/content/repositories/releases/")
username = findProperty("smeupUsername")
password = findProperty("smeupPassword")
}
}
}
def customizePom(pom) {
pom.withXml {
def root = asNode()
// eliminate test-scoped dependencies (no need in maven central POMs)
root.dependencies.removeAll { dep ->
dep.scope == "test"
}
// add all items necessary for maven central publication
root.children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
description 'A JAva virtual machine Rpg Interpreter written in KOtlin'
name 'Jariko'
url 'https://github.com/smeup/jariko'
organization {
name 'com.github.smeup'
url 'https://github.com/smeup'
}
issueManagement {
system 'GitHub'
url 'https://github.com/smeup/jariko/issues'
}
licenses {
license {
name 'Apache License 2.0'
url 'https://github.com/smeup/jariko/blob/master/LICENSE.md'
distribution 'repo'
}
}
scm {
url 'https://github.com/smeup/jariko'
connection 'scm:git:git://github.com/smeup/jariko.git'
developerConnection 'scm:git:ssh://[email protected]:smeup/jariko.git'
}
developers {
developer {
name 'smeup'
}
}
}
}
}