-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (70 loc) · 2.16 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
import java.nio.charset.StandardCharsets
plugins {
id 'java'
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.5.21'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id "com.github.ben-manes.versions" version "0.39.0"
}
group 'eu.alessiobianchi'
version '0.1.0'
repositories {
mavenCentral()
jcenter()
maven { url 'https://maven.google.com' }
}
mainClassName = "eu.alessiobianchi.svgandroidrasterizer.Main"
jar {
manifest {
attributes 'Implementation-Version': version
}
}
shadowJar {
archiveName = 'svg-android-rasterizer.jar'
}
run {
// to pass arguments to the run task:
// gw run -Pargs="-t foo"
if (project.hasProperty('args')) {
//noinspection GroovyAssignabilityCheck
args project.args.split('\\s+')
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1"
implementation "org.jetbrains.kotlin:kotlin-reflect" // transitiva di com.android.tools:sdk-common
implementation "com.github.ajalt:clikt:2.8.0"
implementation "org.json:json:20210307"
implementation "com.android.tools:sdk-common:30.0.0-rc01"
implementation "com.android.tools:common:30.0.0-rc01"
implementation "com.andreapivetta.kolor:kolor:1.0.0"
}
task dist(type: Copy) {
dependsOn shadowJar
group = 'distribution'
from shadowJar.archivePath
into rootProject.projectDir
}
task distExec {
dependsOn shadowJar
group = 'distribution'
description "Creates an executable JAR that can be executed directly, without using 'java -jar' (*nix only)"
doLast {
File jar = shadowJar.archivePath
byte[] jarContent = jar.readBytes()
File out = new File(rootProject.projectDir, jar.name.replace(".jar", ""))
FileOutputStream fos = new FileOutputStream(out)
fos.write("#!/usr/bin/env java -jar\n".getBytes(StandardCharsets.UTF_8))
fos.write(jarContent)
fos.close()
out.executable = true
}
}
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}