-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathbuild.gradle
178 lines (152 loc) · 4.67 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
}
}
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'idea'
group = 'com.bertramlabs.plugins'
sourceCompatibility = '1.17'
targetCompatibility = '1.17'
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
repositories {
mavenCentral()
}
configurations {
provided
doc.extendsFrom(runtime)
}
sourceSets {
main {
compileClasspath += configurations.provided
groovy.srcDirs += ['src/main/java']
java.srcDirs = []
}
}
java {
withSourcesJar()
withJavadocJar()
}
groovydoc {
docTitle "Asset Pipeline Core"
windowTitle "Asset Pipeline For the JVM API Doc"
groovyClasspath = configurations.doc
classpath = configurations.runtime
// Links to external Javadoc, currently only the J2SE links are working properly
link('http://download.oracle.com/javase/8/docs/api/', 'java.', 'org.xml', 'javax.', 'org.xml.')
link('http://groovy.codehaus.org/api/', 'groovy.', 'org.apache.groovy.')
}
dependencies {
compileOnly 'org.codehaus.groovy:groovy:3.0.20'
compileOnly 'org.codehaus.groovy:groovy-json:3.0.20'
compileOnly 'org.codehaus.groovy:groovy-templates:3.0.20'
doc 'org.apache.groovy:groovy-all:4.0.22'
doc 'org.fusesource.jansi:jansi:1.11'
compileOnly 'org.mozilla:rhino:1.7R4'
api("org.graalvm.sdk:graal-sdk:22.0.0.2")
api("org.graalvm.js:js:22.0.0.2")
api("org.graalvm.js:js-scriptengine:22.0.0.2")
compileOnly 'com.google.javascript:closure-compiler-unshaded:v20240317'
api 'org.slf4j:slf4j-api:1.7.28'
//api 'log4j:log4j:1.2.16'
testImplementation project(':asset-pipeline-classpath-test')
testImplementation 'org.apache.groovy:groovy-all:4.0.22'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testRuntimeOnly 'org.slf4j:slf4j-simple:1.7.28'
compileOnly 'org.slf4j:slf4j-simple:1.7.28'
}
publishing {
publications {
maven(MavenPublication) {
artifactId 'asset-pipeline-core'
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'asset-pipeline-core'
description 'JVM Asset Pipeline library for serving static web assets, bundling, minifying, and extensibility for transpiling.'
url 'https://github.com/bertramdev/asset-pipeline-core'
scm {
url 'https://github.com/bertramdev/asset-pipeline-core'
connection 'scm:https://[email protected]/bertramdev/asset-pipeline-core.git'
developerConnection 'scm:git://github.com/bertramdev/asset-pipeline-core.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'davydotcom'
name 'David Estes'
email '[email protected]'
}
}
}
}
from components.java
}
}
repositories {
maven {
if( !isReleaseVersion ) {
url = "http://nexus.bertramlabs.com/content/repositories/snapshots"
if(project.hasProperty('labsNexusUser')) {
credentials {
username = labsNexusUser
password = labsNexusPassword
}
}
}
}
}
}
task(console, dependsOn: 'classes', type: JavaExec) {
main = 'groovy.ui.Console'
classpath = sourceSets.main.runtimeClasspath
}
tasks.register("depsize") {
description = 'Prints dependencies for "default" configuration'
doLast() {
listConfigurationDependencies(configurations.runtimeClasspath)
}
}
tasks.register("depsize-all-configurations") {
description = 'Prints dependencies for all available configurations'
doLast() {
configurations
.findAll { it.isCanBeResolved() }
.each { listConfigurationDependencies(it) }
}
}
def listConfigurationDependencies(Configuration configuration) {
def formatStr = "%,10.2f"
def size = configuration.collect { it.length() / (1024 * 1024) }.sum()
def out = new StringBuffer()
out << "\nConfiguration name: \"${configuration.name}\"\n"
if (size) {
out << 'Total dependencies size:'.padRight(65)
out << "${String.format(formatStr, size)} Mb\n\n"
configuration.sort { -it.length() }
.each {
out << "${it.name}".padRight(65)
out << "${String.format(formatStr, (it.length() / 1024))} kb\n"
}
} else {
out << 'No dependencies found'
}
println(out)
}
test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}