forked from snowplow/snowplow-java-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
143 lines (120 loc) · 4.18 KB
/
build.gradle
File metadata and controls
143 lines (120 loc) · 4.18 KB
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
/*
* Copyright (c) 2014 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
wrapper.gradleVersion = '2.6'
buildscript {
repositories {
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
}
}
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-idea'
group = 'com.snowplowanalytics'
version = '0.8.2'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
repositories {
// Use 'maven central' for resolving our dependencies
mavenCentral()
// Use 'jcenter' for resolving testing dependencies
jcenter()
}
configure([compileJava, compileTestJava]) {
options.encoding = 'UTF-8'
}
configurations {
provided
}
sourceSets {
main {
compileClasspath += configurations.provided
}
}
dependencies {
// Apache Commons
compile 'commons-codec:commons-codec:1.10'
compile 'commons-net:commons-net:3.3'
// Apache HTTP
optional 'org.apache.httpcomponents:httpclient:4.3.3'
optional 'org.apache.httpcomponents:httpasyncclient:4.0.1'
// Square OK HTTP
optional 'com.squareup.okhttp:okhttp:2.2.0'
// SLF4J logging API
compile 'org.slf4j:slf4j-simple:1.7.7'
// Jackson JSON processor
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.1.1'
// Preconditions
compile 'com.google.guava:guava:18.0'
// Testing libraries
testCompile 'junit:junit:4.11'
testCompile 'com.github.tomakehurst:wiremock:1.53'
testCompile 'org.skyscreamer:jsonassert:1.2.3'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'com.squareup.okhttp:mockwebserver:2.1.0'
}
task sourceJar(type: Jar, dependsOn: 'generateSources') {
from sourceSets.main.allJava
}
// Publishing
publishing {
publications {
mavenJava(MavenPublication) {
artifactId 'snowplow-java-tracker'
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
repositories {
maven {
url "$buildDir/repo" // change to point to your repo, e.g. http://my.org/repo
}
}
}
task generateSources {
project.ext.set("outputDir", "$projectDir/src/main/java/com/snowplowanalytics/snowplow/tracker")
doFirst {
println outputDir
def srcFile = new File((String)outputDir, "Version.java")
srcFile.parentFile.mkdirs()
srcFile.write(
"""/*
* Copyright (c) 2014-2015 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package com.snowplowanalytics.snowplow.tracker;
// DO NOT EDIT. AUTO-GENERATED.
public class Version {
static final String TRACKER = "java-$project.version";
static final String VERSION = "$project.version";
}
""")
}
}
compileJava.dependsOn generateSources
compileJava.source generateSources.outputs.files, sourceSets.main.java