-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
127 lines (107 loc) · 3.58 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
buildscript {
ext.kotlin_version = '1.2.10'
ext.serialization_version = '0.4'
repositories {
jcenter()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$serialization_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
allprojects {
group 'de.jonasfranz.gitea'
version '0.0.6'
repositories {
jcenter()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
}
apply plugin: 'kotlin'
subprojects {
apply plugin: 'kotlinx-serialization'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
def varintName = ""
if (project.name == "jvm") {
varintName = "${rootProject.name}"
} else {
varintName = "${rootProject.name}-${project.name}"
}
afterEvaluate {
task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.kotlin
duplicatesStrategy = "exclude"
def platformSrc = sourceSets.main.kotlin
def commonSrc = project(':common').sourceSets.main.kotlin
from (platformSrc + commonSrc)
}
}
tasks.withType(Jar) {
archivesBaseName = varintName
}
// --------------- pom configuration ---------------
def pomConfig = {
licenses {
license {
name "MIT License"
url "https://opensource.org/licenses/mit-license.php"
distribution "repo"
}
}
developers {
developer {
id "JonasFranzDEV"
name "Jonas Franz"
organization "Jonas Franz Software"
organizationUrl "https://www.jonasfranz.de"
}
}
scm {
url "https://github.com/JonasFranzDEV/gitea-client"
}
}
publishing {
publications {
mavenProject(MavenPublication) {
from components.java
groupId project.group
artifactId varintName
version project.version
artifact sourceJar {
classifier "sources"
}
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', 'Kotlin based API client for Gitea')
root.appendNode('url', 'https://github.com/JonasFranzDEV/gitea-client')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['mavenProject']
pkg {
repo = 'gitea-client'
name = 'gitea-client'
userOrg = 'jonasfranzdev'
licenses = ['MIT']
vcsUrl = 'https://github.com/JonasFranzDEV/gitea-client'
websiteUrl = 'https://github.com/JonasFranzDEV/gitea-client'
issueTrackerUrl = 'https://github.com/JonasFranzDEV/gitea-client/issues'
githubRepo = 'JonasFranzDEV/gitea-client'
version {
name = project.version
}
}
}
}