-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
112 lines (94 loc) · 2.71 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
111
112
plugins {
id "com.ms.gradle.application"
}
version = "1.0"
repositories {
maven {
url "repo/maven"
}
}
dependencies {
implementation fileTree("repo/local").include("*.jar")
implementation "com.ms.test:datetime-current:4.5"
}
tasks.jar {
manifest {
attributes(
"Implementation-Title": "Application plugin functional test",
"Implementation-Version": "1.0.b42")
}
}
task emptyJar(type: Jar) {
archiveBaseName = "empty"
}
// --- Valid usages ---
applications.main {
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("simple") {
fromSourceSet sourceSets.main
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("withoutRawJar") {
dependencies = locateDependencies(sourceSets.main)
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("withoutDependencies") {
rawJar = locateRawJar(sourceSets.main)
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("complex") {
description = "This is an application showcasing all the possibilities of the DSL."
applicationBaseName = "complexApp"
rawJar = tasks.jar
dependencies = configurations.runtimeClasspath
dependencyDirectoryName = "complexDeps"
mainClass = "com.ms.test.app.PrintTimestamp"
applicationJar {
destinationDirectory = layout.buildDirectory.dir("appsComplex")
archiveBaseName = "complexJar"
}
distribution {
contents.from file("README.md")
}
}
task manualApplicationJar(type: com.ms.gradle.application.ApplicationJar) {
fromSourceSet sourceSets.main
mainClass = "com.ms.test.app.PrintTimestamp"
archiveBaseName = "manualJar"
}
distributions {
manual {
distributionBaseName = "manualDist"
contents {
with manualApplicationJar.applicationCopySpec()
from file("README.md")
}
}
}
task installFullyManualDist(type: Sync) {
into layout.buildDirectory.dir("install/fullyManual")
with manualApplicationJar.applicationCopySpec().into("app")
from file("README.md")
eachFile {
relativePath = relativePath.prepend("content")
}
}
// --- Invalid usages ---
applications.create("missingDependencyDirectoryName") {
fromSourceSet sourceSets.main
dependencyDirectoryName.convention(null).set(null)
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("emptyDependencyDirectoryName") {
fromSourceSet sourceSets.main
dependencyDirectoryName = ""
mainClass = "com.ms.test.app.PrintTimestamp"
}
applications.create("missingMainClass") {
fromSourceSet sourceSets.main
}
applications.create("emptyMainClass") {
fromSourceSet sourceSets.main
mainClass = ""
}