-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.gradle
More file actions
180 lines (158 loc) · 5.12 KB
/
build.gradle
File metadata and controls
180 lines (158 loc) · 5.12 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.4.1/userguide/tutorial_java_projects.html
*/
plugins {
id 'java'
id 'com.google.protobuf' version '0.8.16'
id 'idea'
id 'maven-publish'
id 'signing'
id 'com.github.spotbugs' version '5.2.1'
}
archivesBaseName = 'durabletask-azuremanaged'
group 'com.microsoft'
version = '1.5.1-preview.1'
def grpcVersion = '1.62.2'
def azureCoreVersion = '1.46.0'
def azureIdentityVersion = '1.11.2'
// When build on local, you need to set this value to your local jdk11 directory.
// Java11 is used to compile and run all the tests.
def PATH_TO_TEST_JAVA_RUNTIME = System.env.JDK_11 ?: System.getProperty("java.home")
repositories {
mavenCentral()
}
dependencies {
implementation project(':client')
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "com.azure:azure-core:${azureCoreVersion}"
implementation "com.azure:azure-identity:${azureIdentityVersion}"
// Test dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.0'
testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-junit-jupiter:5.3.1'
testImplementation "io.grpc:grpc-netty:${grpcVersion}"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}
compileJava {
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"
}
test {
useJUnitPlatform()
include '**/*Test.class'
}
publishing {
repositories {
maven {
url "file://$project.rootDir/repo"
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = archivesBaseName
pom {
name = 'Durable Task Azure Managed SDK for Java'
description = 'This package contains classes and interfaces for building Durable Task orchestrations in Java using Azure Managed mode.'
url = "https://github.com/microsoft/durabletask-java/tree/main/azuremanaged"
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/azuremanaged"
}
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.2'
effort = 'max'
reportLevel = '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
}
}
}
// Add this after the plugins block
def generatedSourcesDir = file("$buildDir/generated/sources/version/java/main")
sourceSets {
main {
java {
srcDirs += generatedSourcesDir
}
}
}
task generateVersionInfo(type: Copy) {
from 'src/main/resources/VersionInfo.java.template'
into generatedSourcesDir
expand(version: project.version)
rename { 'VersionInfo.java' }
}
compileJava.dependsOn generateVersionInfo
tasks.named('sourcesJar') {
dependsOn generateVersionInfo
}