-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.gradle
More file actions
155 lines (141 loc) · 5.06 KB
/
Copy pathbuild.gradle
File metadata and controls
155 lines (141 loc) · 5.06 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
144
145
146
147
148
149
150
151
152
153
154
155
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'com.github.spotbugs' version '6.4.8'
}
group 'com.microsoft'
version = '1.8.0'
archivesBaseName = 'durabletask-azure-functions'
def protocVersion = '3.25.8'
// Java 11 is used to compile and run all tests. Set the JDK_11 env var to your
// local JDK 11 home directory, e.g. C:/Program Files/Java/openjdk-11.0.12_7/
// If unset, falls back to the current JDK running Gradle.
def rawJdkPath = System.env.JDK_11 ?: System.getProperty("java.home")
// Handle case where JDK_11 points to an executable (e.g., .../bin/javac.exe)
// instead of the JDK home directory — walk up to the JDK root.
def PATH_TO_TEST_JAVA_RUNTIME = rawJdkPath
if (rawJdkPath != null) {
def f = new File(rawJdkPath)
if (f.isFile()) {
PATH_TO_TEST_JAVA_RUNTIME = f.parentFile.parentFile.absolutePath
}
}
// Append .exe on Windows when invoking javac/java directly
def isWindows = System.getProperty("os.name").toLowerCase().contains("win")
def exeSuffix = isWindows ? ".exe" : ""
repositories {
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
api project(':client')
implementation group: 'com.microsoft.azure.functions', name: 'azure-functions-java-library', version: '3.2.3'
implementation "com.google.protobuf:protobuf-java:${protocVersion}"
compileOnly "com.microsoft.azure.functions:azure-functions-java-spi:1.1.0"
// Test dependencies
testImplementation 'org.mockito:mockito-core:5.21.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.21.0'
testImplementation platform('org.junit:junit-bom:5.14.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
options.fork = true
options.forkOptions.executable = "${PATH_TO_TEST_JAVA_RUNTIME}/bin/javac${exeSuffix}"
}
test {
useJUnitPlatform()
executable = "${PATH_TO_TEST_JAVA_RUNTIME}/bin/java${exeSuffix}"
}
publishing {
repositories {
maven {
url "file://$project.rootDir/repo"
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = archivesBaseName
pom {
name = 'Azure Durable Functions SDK for Java'
description = 'This package contains classes, interfaces, and annotations for developing with Azure Durable Functions in Java.'
url = "https://github.com/microsoft/durabletask-java/tree/main/azurefunctions"
licenses {
license {
name = "MIT License"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}
developers {
developer {
id = "Microsoft"
name = "Microsoft Corporation"
}
}
scm {
connection = "scm:git:https://github.com/microsoft/durabletask-java"
developerConnection = "scm:git:git@github.com:microsoft/durabletask-java"
url = "https://github.com/microsoft/durabletask-java/tree/main/azurefunctions"
}
// use below script to include compile-only dependencies when generated pom file.
// This is pain point when we onboard API docs as the missing compile-only dependencies crash the
// API doc's team onboarding pipeline.
withXml {
project.configurations.compileOnly.allDependencies.each { dependency ->
asNode().dependencies[0].appendNode("dependency").with {
it.appendNode("groupId", dependency.group)
it.appendNode("artifactId", dependency.name)
it.appendNode("version", dependency.version)
it.appendNode("scope", "provided")
}
}
}
}
}
}
}
signing {
required = !project.hasProperty("skipSigning")
sign publishing.publications.mavenJava
}
java {
withSourcesJar()
withJavadocJar()
}
spotbugs {
toolVersion = '4.9.8'
effort = com.github.spotbugs.snom.Effort.valueOf('MAX')
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('HIGH')
ignoreFailures = true
excludeFilter = file('spotbugs-exclude.xml')
}
spotbugsMain {
reports {
html {
required = true
stylesheet = 'fancy-hist.xsl'
}
xml {
required = true
}
}
}
spotbugsTest {
reports {
html {
required = true
stylesheet = 'fancy-hist.xsl'
}
xml {
required = true
}
}
}