-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
110 lines (98 loc) · 3.83 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
plugins {
id 'de.undercouch.download' version '5.6.0'
id 'maven-publish'
}
import de.undercouch.gradle.tasks.download.Download
import org.gradle.api.publish.maven.internal.publication.MavenPomInternal
group 'com.jetbrains.jdk'
Provider<String> versionString = provider {
if (!project.hasProperty('jdkVersion')) {
throw new GradleException("Project property 'jdkVersion' must be set")
}
if (!project.hasProperty('jdkBuild')) {
throw new GradleException("Project property 'jdkBuild' must be set")
}
"$jdkVersion-$jdkBuild".toString()
}
def architectures = [
'osx-aarch64',
'osx-x64',
'linux-aarch64',
'linux-x64',
'windows-aarch64',
'windows-x64'
]
def distroTypes = ['jbr_jcef', 'jbr', 'jbrsdk']
MavenPublication createPublication(String distroType, Provider<String> versionString) {
project.publishing.publications.create(distroType, MavenPublication) {
artifactId distroType
pom {
((MavenPomInternal) it).coordinates.version = versionString
licenses {
// official SPDX identifier
// see https://spdx.org/licenses/ for list
license {
name = "GPL-2.0-only"
url = versionString.map { "https://github.com/JetBrains/JetBrainsRuntime/blob/jb$it/LICENSE".toString() }
comments = "GNU GENERAL PUBLIC LICENSE Version 2, June 1991"
distribution = "repo"
}
license {
name = "WITH Classpath-exception-2.0"
url = versionString.map { "https://github.com/JetBrains/JetBrainsRuntime/blob/jb$it/ADDITIONAL_LICENSE_INFO".toString() }
comments = "Oracle Classpath exception 2.0"
distribution = "repo"
}
license {
name = "WITH OpenJDK-assembly-exception-1.0"
url = versionString.map { "https://github.com/JetBrains/JetBrainsRuntime/blob/jb$it/ASSEMBLY_EXCEPTION".toString() }
comments = "OpenJDK Assembly exception 1.0"
distribution = "repo"
}
}
organization {
name = "JetBrains s.r.o"
url = "https://www.jetbrains.com"
}
scm {
tag = versionString.map { "jb$it".toString() }
url = "https://github.com/JetBrains/JetBrainsRuntime.git"
}
}
}
}
distroTypes.each { distroType ->
def publication = createPublication(distroType, versionString)
architectures.each { architecture ->
def downloadTask = tasks.register('get_' + distroType + '_' + architecture, Download) {
def fileName = provider { "${distroType}-${jdkVersion}-${architecture}-${jdkBuild}.tar.gz".toString() }
src fileName.map { "https://cache-redirector.jetbrains.com/intellij-jbr/$it" }
dest layout.buildDirectory.file(fileName)
overwrite false
}
publication.artifact(downloadTask) {
classifier architecture
extension 'tgz'
}
}
}
publishing {
repositories {
maven {
name = "itemisCloud"
url = uri("https://artifacts.itemis.cloud/repository/maven-mps-releases/")
credentials {
username = project.findProperty("artifacts.itemis.cloud.user")
password = project.findProperty("artifacts.itemis.cloud.pw")
}
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/mbeddr/build.publish.jdk")
credentials {
username = project.findProperty("gpr.user")
password = project.findProperty("gpr.token")
}
}
}
}