-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproto.gradle
More file actions
125 lines (110 loc) · 2.95 KB
/
Copy pathproto.gradle
File metadata and controls
125 lines (110 loc) · 2.95 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
import java.text.SimpleDateFormat
def read_versions() {
def props = new Properties()
props.load(new FileInputStream("${System.getenv("REPO_HOME")}/versions.properties"))
return props
}
def papeeriaVersion(String defaultVersion) {
def versions = read_versions()
if (project.hasProperty("ver")) {
return project["ver"]
}
if (versions["papeeria"] != null && !String.valueOf(versions["papeeria"]).isAllWhitespace()) {
return versions["papeeria"]
}
return defaultVersion
}
def this_version = papeeriaVersion(new SimpleDateFormat("yyyy.MM.dd").format(new Date()))
def protobuf_version = read_versions()["protobuf"]
buildscript {
ext {
grpc_version = "1.36.0"
kotlin_version = "1.5.0"
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'com.google.protobuf'
apply plugin: 'maven-publish'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
repositories {
mavenLocal()
mavenCentral()
}
sourceSets {
main {
proto {
}
java {
srcDirs "$projectDir/src/generated/main/java"
}
kotlin {
srcDirs "$projectDir/src/main/kotlin"
include "com/bardsoftware/papeeria/backend/SSL.kt"
}
}
}
dependencies {
api "com.google.cloud:google-cloud-core:1.92.+"
api "com.google.cloud:google-cloud-secretmanager:1.4.+"
implementation "com.google.protobuf:protobuf-java:$protobuf_version"
implementation "io.grpc:grpc-protobuf:$grpc_version"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api 'org.slf4j:slf4j-api:1.7.30'
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobuf_version"
generatedFilesBaseDir = "$projectDir/src/generated"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpc_version"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
from sourceSets.main.output
from sourceSets.main.allSource
include "com/bardsoftware/papeeria/backend/FileProcessingBackend*"
include "com/bardsoftware/papeeria/backend/SSL*"
include "**/*.proto"
}
group 'com.bardsoftware.papeeria.backend'
version "$this_version"
publishing {
repositories {
maven {
name "papeeria-maven"
url "gcs://papeeria-maven-repo/maven2"
}
}
publications {
libbackyardApi(MavenPublication) {
artifactId = 'libbackyard-proto'
from components.java
}
}
}
publishToMavenLocal.doLast {
println("Published version $this_version")
}