-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
68 lines (55 loc) · 1.53 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
/*
* Copyright 2020-present, Nike, Inc.
* All rights reserved.
*
* This source code is licensed under the Apache-2.0 license found in
* the LICENSE file in the root directory of this source tree.
*/
plugins {
id 'java'
id 'application'
id "com.github.johnrengelman.shadow" version "6.0.0"
id 'idea'
}
repositories {
mavenCentral()
jcenter()
mavenLocal()
}
//http://www.gradle.org/docs/current/userguide/java_plugin.html
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
mainClassName = 'com.nike.mycli.Main'
startShadowScripts {
applicationName = 'mycli'
}
dependencies {
implementation 'com.nike:gimme-a-cli:1.0.0'
implementation "ch.qos.logback:logback-classic:1.2.3"
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}
shadowJar {
def releaseVersion = version
doFirst {
ant.replace(file: "$buildDir/resources/main/mycli.properties", token: "@@RELEASE@@", value: releaseVersion)
}
}
/* Tasks for running CLI commands from Gradle */
class CliExec extends JavaExec {
CliExec() {
classpath = project.sourceSets.main.runtimeClasspath
main = project.mainClassName
group = "CLI"
}
}
// Example of defining a CLI command as a Gradle task, e.g., ./gradlew helloWorldFromGradle
task helloWorldFromGradle(type: CliExec) {
description = "Example of defining a CLI command as a Gradle task"
// arguments to pass to the application
args 'hello', '--name', 'world from gradle'
}