-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.gradle
70 lines (59 loc) · 2.41 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
buildscript {
repositories {
mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } }
}
dependencies {
classpath 'com.palantir.jakartapackagealignment:jakarta-package-alignment:0.6.0'
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.19.0'
classpath 'com.palantir.gradle.failure-reports:gradle-failure-reports:1.13.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:3.1.0'
classpath 'com.palantir.gradle.jdks:gradle-jdks:0.59.0'
classpath 'com.palantir.gradle.jdkslatest:gradle-jdks-latest:0.16.0'
}
}
allprojects {
apply plugin: 'com.palantir.jakarta-package-alignment'
}
/**
* Previously we used a shell script to publish the distribution to bintray. With the migration to maven-central, we
* need to leverage more tooling coming from 'gradle-external-publish-plugin'. Based on that, this repo is currently
* in an awkward split-mode. This Gradle setup is just for publishing the dist to maven-central. The actual build and
* compilation is still done through yarn (see 'package.json').
* TODO(fawind): Move this project fully to Gradle (i.e. using 'gradlets/gradle-typescript').
*/
apply plugin: 'com.palantir.external-publish-dist'
apply plugin: 'com.palantir.failure-reports'
apply plugin: 'com.palantir.git-version'
apply plugin: 'com.palantir.jdks'
apply plugin: 'com.palantir.jdks.latest'
group 'com.palantir.conjure.typescript'
version gitVersion()
task verifyBinariesExist() {
doLast {
[file('dist/bin/conjure-typescript'), file('dist/bin/conjure-typescript.bat')]
.forEach({
if (!it.exists()) {
throw new GradleException("Compiled binary file does not exist: ${it}")
}
})
}
}
task distTar(type: Tar) {
String publicationName = "conjure-typescript-${gitVersion()}"
archiveFileName = "${publicationName}.tgz"
destinationDirectory = layout.buildDirectory.dir('dist')
compression Compression.GZIP
into("/${publicationName}/bin") {
from 'dist/bin'
}
eachFile { file ->
if (!file.getName().endsWith(".bat")) {
file.setMode(0755)
}
}
}
tasks.distTar.dependsOn(tasks.verifyBinariesExist)
jdks {
daemonTarget = 17
}