generated from adempiere/adempiere-grpc-template-service
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
172 lines (153 loc) · 5.07 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
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
plugins {
id 'java'
id 'com.google.protobuf' version '0.9.4'
id 'idea'
id 'application'
id 'visual-studio'
}
group 'com.nikhilm'
sourceCompatibility = 1.11
def grpcVersion = '1.62.2'
def protobufVersion = '3.25.3'
def baseVersion = '3.9.4'
def baseGroupId = 'io.github.adempiere'
def privateDependencyBaseVersion = "adempiere-3.9.4"
def descriptorFile = "adempiere-processors-service.dsc"
startScripts.enabled = false
ext {
javaMainClass = "org.spin.processor.server.ProcessorServer"
}
application {
mainClass.set(javaMainClass)
}
jar {
manifest {
attributes(
"Main-Class": javaMainClass
)
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
// Adempiere GitHub Organization
url = findProperty("deployRepository") ?: System.properties['deploy.repository'] ?: System.getenv("GITHUB_DEPLOY_REPOSITORY") ?: 'https://maven.pkg.github.com/adempiere/adempiere'
credentials {
// project property, system property, enviroment variable
username = findProperty("deployUsername") ?: System.properties['deploy.user'] ?: System.getenv("GITHUB_DEPLOY_USER")
password = findProperty("deployToken") ?: System.properties['deploy.token'] ?: System.getenv("GITHUB_DEPLOY_TOKEN")
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
all().configureEach { task ->
// If true, will generate a descriptor_set.desc file under
// task.outputBaseDir. Default is false.
// See --descriptor_set_out in protoc documentation about what it is.
task.generateDescriptorSet = true
// Allows to override the default for the descriptor set location
task.descriptorSetOptions.path = "${projectDir}/build/descriptors/${descriptorFile}"
// task.descriptorSetOptions.path = "${projectDir}/build/descriptors/adempiere-processors-service.dsc"
// If true, the descriptor set will contain line number information
// and comments. Default is false.
task.descriptorSetOptions.includeSourceInfo = true
// If true, the descriptor set will contain all transitive imports and
// is therefore self-contained. Default is false.
task.descriptorSetOptions.includeImports = true
}
}
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
srcDirs 'src/main/proto'
}
resources {
srcDirs 'src/main/java'
include 'org/spin/base/version.properties'
}
}
}
// Copy proto descriptor another folder
allprojects {
task copyDescriptor(type: Copy) {
from "${projectDir}/build/descriptors/${descriptorFile}"
into "${projectDir}/docker-compose/envoy/definitions"
// rename { "${descriptorFile}" }
}
tasks.matching {
it.name.startsWith('compileJava')
}.each { task ->
task.finalizedBy copyDescriptor
}
}
task AdempiereProcessorServer(type: CreateStartScripts) {
mainClass = javaMainClass
applicationName = 'adempiere-processors-service-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}
applicationDistribution.into('bin') {
from(AdempiereProcessorServer)
fileMode = 0755
}
// Create release for project
task createRelease(type: Copy) {
dependsOn build
from file("$buildDir/distributions/")
into file("$buildDir/release/")
//destinationDir(file('build/release/'))
doLast {
file('build/release/')
.listFiles({file -> file.isFile()} as FileFilter).sort()
.each { File file ->
ant.checksum file: file
}
}
}
dependencies {
implementation fileTree(
dir: 'dependencies',
include: [
'*.jar'
]
)
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-alts:${grpcVersion}"
implementation "io.netty:netty-handler:4.1.107.Final"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty:${grpcVersion}"
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation "io.jsonwebtoken:jjwt-api:0.12.6"
implementation "io.jsonwebtoken:jjwt-impl:0.12.6"
implementation "io.jsonwebtoken:jjwt-jackson:0.12.6"
//implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
//implementation 'com.sun.xml.bind:jaxb-impl:3.0.0-M4'
//implementation 'com.sun.xml.bind:jaxb-core:3.0.0-M4'
//implementation 'javax.activation:activation:1.1.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2'
// ADempiere Core
implementation "${baseGroupId}:base:${baseVersion}"
implementation "${baseGroupId}:adempiere-grpc-utils:1.5.6"
implementation "${baseGroupId}:adempiere-business-processors:1.1.8"
// Others
compileOnly 'org.apache.tomcat:annotations-api:6.0.53'
}