-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.gradle
100 lines (83 loc) · 2.51 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
plugins {
id "java"
id "idea"
id "org.jetbrains.intellij" version "0.4.13"
id "com.github.johnrengelman.shadow" version "5.1.0"
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
group = 'com.github.rholder'
version = '4.0.0-SNAPSHOT'
allprojects {
repositories {
mavenCentral()
maven {
name 'gradle-releases'
url 'https://repo.gradle.org/gradle/libs-releases'
}
}
intellij {
version ideaVersion
type "IC"
pluginName 'gradle-view'
downloadSources true
}
}
configurations {
provided
}
idea.module.scopes.COMPILE.plus += [configurations.provided]
sourceSets.main {
compileClasspath += configurations.provided
}
jar {
into('META-INF') {
from 'META-INF/plugin.xml'
from 'LICENSE'
}
// gradle-acumen is extracted and referenced at runtime so it needs to exist inside this jar
into('') {
// manually add the gradle-acumen jar inside this new jar
from 'gradle-acumen/build/libs/gradle-acumen-0.3.0.jar'
}
}
dependencies {
compile "org.gradle:gradle-tooling-api:${gradleToolingApiVersion}"
compile 'com.google.guava:guava:11.0.2'
compile 'commons-io:commons-io:2.2'
compile 'commons-lang:commons-lang:2.6'
runtime 'org.slf4j:slf4j-simple:1.7.2'
// force this project to build before assembling jar so we can stuff it in there
provided project(':gradle-acumen')
// just need the api jar
compile(project(':gradle-acumen-api')) {
transitive = false
}
}
task distPlugin(type: Zip, dependsOn: jar) {
description = "Generate the IntelliJ plugin archive from the current project."
group = "Distribution"
into("${project.name}/lib") {
from jar.archivePath
from configurations.runtime
}
}
shadowJar {
// this is the standalone main that will run outside of IDEA, shadowing builds a fat jar
manifest {
attributes 'Main-Class': 'com.github.rholder.gradle.ui.DependencyViewerStandalone'
}
}
task distStandalone(type: Zip, dependsOn: shadowJar) {
description = "Generate a standalone binary from the current project."
group = "Distribution"
archiveFileName = 'gradle-view-standalone.jar'
// grab everything from inside the shadow'd jar, including META-INF
into('') {
from zipTree(shadowJar.archivePath)
}
// manually add the gradle-acumen jar inside this new jar
into('') {
from 'gradle-acumen/build/libs/gradle-acumen-0.3.0.jar'
}
}