forked from StubbornJava/StubbornJava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
79 lines (69 loc) · 2.18 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
// {{start:build}}
buildscript {
repositories {
jcenter()
}
// buildscript dependencies can be used for build time plugins.
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.4"
}
}
// Include a gradle script that has all of our dependencies split out.
apply from: "gradle/dependencies.gradle"
allprojects {
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
// Using Jitpack so I need the repo name in the group to match.
group = 'com.stubbornjava.StubbornJava'
version = '0.0.0-SNAPSHOT'
sourceSets {
main {
java {
srcDirs = ["src/main/java", "src/generated/java"]
}
resources {
srcDirs = ["src/main/resources", "ui/assets"]
}
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' } // This allows us to use jitpack projects
}
configurations.all {
resolutionStrategy {
// fail eagerly on version conflict (includes transitive dependencies)
// e.g. multiple different versions of the same dependency (group and name are equal)
failOnVersionConflict()
// Auto force all of our explicit dependencies.
libs.each { k, v -> force(v) }
force('commons-logging:commons-logging:1.2')
force('com.google.code.findbugs:jsr305:3.0.2')
// cache dynamic versions for 10 minutes
cacheDynamicVersionsFor 10*60, 'seconds'
// don't cache changing modules at all
cacheChangingModulesFor 0, 'seconds'
}
}
// Maven Publish Begin
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
// This publishes sources with our jars.
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
// Maven Publish End
}
// {{end:build}}