This repository was archived by the owner on Jul 10, 2024. It is now read-only.
forked from dstendardi/snowplow-java-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
103 lines (89 loc) · 3.23 KB
/
build.gradle
File metadata and controls
103 lines (89 loc) · 3.23 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
/*
* 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.
*/
// Applying the java plugin to add support for Java
apply plugin: 'java'
// As per http://www.gradle.org/docs/current/userguide/publishing_maven.html
apply plugin: 'maven-publish'
apply plugin: 'war'
dependencies {
compile project(':snowplow-java-tracker-core')
runtime project(':snowplow-java-tracker-core')
}
allprojects {
apply plugin: 'java'
group = 'com.snowplowanalytics'
version = '0.5.1'
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
repositories {
// Use 'maven central' for resolving our dependencies
mavenCentral()
}
}
task sourceJar(type: Jar, dependsOn: 'generateSources') {
from sourceSets.main.allJava
}
// Publishing
publishing {
publications {
mavenJava(MavenPublication) {
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 testAll(dependsOn: assemble) {
subprojects.each {project ->
project.tasks.withType(Jar).each {
// Dependencies for our production and test code
dependencies {
}
}
}
}
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 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;
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