-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
161 lines (147 loc) · 5.13 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
plugins {
id 'java'
id 'com.google.protobuf' version '0.9.3'
id 'idea'
id 'application'
id 'visual-studio'
id 'maven-publish'
}
group 'com.nikhilm'
sourceCompatibility = 1.11
def grpcVersion = '1.62.2'
def baseVersion = '3.9.4'
def baseGroupId = 'io.github.adempiere'
def privateDependencyBaseVersion = "adempiere-3.9.4"
startScripts.enabled = false
ext {
javaMainClass = "org.spin.mobile_service.server.MobileServer"
}
application {
mainClass.set(javaMainClass)
}
jar {
manifest {
attributes(
"Main-Class": javaMainClass
)
}
}
repositories {
mavenLocal()
mavenCentral()
maven {
// Adempiere GitHub Organization
url = 'https://maven.pkg.github.com/adempiere/adempiere'
credentials {
// project property, system properrty, 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:3.12.0"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.34.1'
}
}
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/adempiere-mobile-service.pb"
// 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
}
// 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}/docker-compose/envoy/definitions/adempiere-mobile-service.pb"
// // 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'
}
}
}
task AdempiereMobileServer(type: CreateStartScripts) {
mainClass = javaMainClass
applicationName = 'adempiere-mobile-service-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}
applicationDistribution.into('bin') {
from(AdempiereMobileServer)
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.99.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:3.24.3'
implementation 'com.google.protobuf:protobuf-java-util:3.24.3'
//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.15.0'
// ADempiere Core
implementation "${baseGroupId}:base:${baseVersion}"
implementation "${baseGroupId}:adempiere-grpc-utils:1.5.1"
implementation "${baseGroupId}:human-resource-and-payroll:${baseVersion}"
// Others
compileOnly 'org.apache.tomcat:annotations-api:6.0.53'
}