-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
101 lines (84 loc) · 2.85 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
buildscript {
repositories {
mavenCentral() // this applies only to the Gradle 'Shadow' plugin
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'scala'
id 'maven-publish'
id "com.github.alisiikh.scalastyle" version "3.4.1"
}
repositories {
mavenCentral()
}
group 'spark.privacy'
version '1.1-SNAPSHOT'
ext {
javaVersion = '1.11'
scalaVersion = '2.13'
differentialPrivacyVersion = '1.1.0'
sparkVersion = '3.2.2'
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
configurations {
privacyShadowJar
}
dependencies {
privacyShadowJar 'com.google.guava:guava:30.1.1-jre'
privacyShadowJar 'com.google.protobuf:protobuf-java:3.15.6'
implementation ( "org.apache.spark:spark-core_${scalaVersion}:${sparkVersion}" ) {
exclude group: "com.google.guava", module: "guava"
}
implementation ("org.apache.spark:spark-sql_${scalaVersion}:${sparkVersion}") {
exclude group: "com.google.guava", module: "guava"
}
privacyShadowJar "com.google.privacy.differentialprivacy:differentialprivacy:${differentialPrivacyVersion}"
testImplementation "junit:junit:null"
testImplementation "org.scalatest:scalatest_${scalaVersion}:3.1.2"
testImplementation "org.scalatestplus:junit-4-12_${scalaVersion}:3.1.2.0"
testImplementation "com.holdenkarau:spark-testing-base_${scalaVersion}:${sparkVersion}_1.1.0"
testRuntimeOnly "org.scala-lang.modules:scala-xml_${scalaVersion}:1.2.0"
}
// make compileOnly dependencies available for tests:
sourceSets {
main.java.srcDirs += 'lib/src/main/java'
main.scala.srcDirs += 'lib/src/main/scala'
main.compileClasspath += configurations.privacyShadowJar
main.runtimeClasspath += configurations.privacyShadowJar
test.compileClasspath += configurations.privacyShadowJar
test.runtimeClasspath += configurations.privacyShadowJar
javadoc.classpath += configurations.privacyShadowJar
}
jar {
manifest {
attributes 'Built-By': System.getProperty('user.name'), 'Build-Jdk': System.getProperty('java.version')
}
}
shadowJar {
configurations = [project.configurations.privacyShadowJar]
mergeServiceFiles()
relocate "com.google", "spark.privacy.com.google"
}
assemble.dependsOn shadowJar
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/gmodena/spark-privacy")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}