-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
158 lines (131 loc) · 4.12 KB
/
build.gradle.kts
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
import java.util.*
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("xyz.sangcomz:gradle-slack-upload-plugin:1.0.0")
}
}
plugins {
kotlin("jvm") version "1.3.61"
`kotlin-dsl`
maven
`maven-publish`
id("com.jfrog.bintray") version "1.8.4"
}
apply {
plugin("xyz.sangcomz.gradle")
}
group = "xyz.sangcomz"
version = "1.0.0"
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.github.kittinunf.fuel:fuel:2.2.1")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
from("LICENCE.md") {
into("META-INF")
}
}
val artifactName = project.name
val artifactGroup = project.group.toString()
val artifactVersion = project.version.toString()
val pomUrl = "https://github.com/sangcomz/gradle-slack-upload-plugin"
val pomScmUrl = "https://github.com/sangcomz/gradle-slack-upload-plugin"
val pomIssueUrl = "https://github.com/sangcomz/gradle-slack-upload-plugin/issues"
val pomDesc = "https://github.com/sangcomz/gradle-slack-upload-plugin"
val githubRepository = "sangcomz/gradle-slack-upload-plugin"
val githubReadme = "README.md"
val pomLicenseName = "The Apache Software License, Version 2.0"
val pomLicenseUrl = "http://www.apache.org/licenses/LICENSE-2.0.txt"
val pomLicenseDist = "repo"
val pomDeveloperId = "sangcomz"
val pomDeveloperName = "Seokwon Jeong"
val pluginDescription = "Upload files to Slack using Gradle Plugin"
publishing {
publications {
create<MavenPublication>("gradle-slack-upload-plugin") {
groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
artifact(sourcesJar)
from(components["java"])
pom.withXml {
asNode().apply {
appendNode("description", pomDesc)
appendNode("name", rootProject.name)
appendNode("url", pomUrl)
appendNode("licenses").appendNode("license").apply {
appendNode("name", pomLicenseName)
appendNode("url", pomLicenseUrl)
appendNode("distribution", pomLicenseDist)
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", pomDeveloperId)
appendNode("name", pomDeveloperName)
}
appendNode("scm").apply {
appendNode("url", pomScmUrl)
}
}
}
}
}
}
val localProperties = Properties()
localProperties.load(project.rootProject.file("local.properties").inputStream())
bintray {
user = localProperties.getProperty("bintrayUser").toString()
key = localProperties.getProperty("bintrayKey").toString()
publish = true
setPublications("gradle-slack-upload-plugin")
pkg.apply {
repo = "maven"
name = artifactName
userOrg = "sangcomz"
githubRepo = githubRepository
vcsUrl = pomScmUrl
description = pluginDescription
setLabels("kotlin", "slack", "uploader", "gradle-plugin")
setLicenses("Apache-2.0")
desc = description
websiteUrl = pomUrl
issueTrackerUrl = pomIssueUrl
githubReleaseNotesFile = githubReadme
version.apply {
name = artifactVersion
desc = pomDesc
released = Date().toString()
vcsTag = artifactVersion
}
}
}
tasks {
"uploadArchives"(Upload::class) {
repositories {
withConvention(MavenRepositoryHandlerConvention::class) {
mavenDeployer {
withGroovyBuilder {
"repository"("url" to uri("repo")) {
}
}
}
}
}
}
}