Skip to content

Commit 58edb20

Browse files
authored
Merge pull request #160 from code-payments/chore/tweak-proto-gradle-setup
Chore/tweak proto gradle setup
2 parents 9b6e880 + c5fcd65 commit 58edb20

3 files changed

Lines changed: 14 additions & 20 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ buildscript {
1717
classpath(Classpath.firebase_perf)
1818
classpath(Classpath.secrets_gradle_plugin)
1919
classpath(Classpath.kotlin_serialization_plugin)
20+
classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.14")
2021
}
2122
}
2223

@@ -33,5 +34,5 @@ allprojects {
3334
}
3435

3536
tasks.register("clean", Delete::class) {
36-
delete(rootProject.buildDir)
37+
delete(rootProject.layout.buildDirectory)
3738
}

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ platform :android do
2121
gradle(task: "test")
2222
end
2323

24-
desc "Builld and Deploy a new version to the Google Play"
24+
desc "Build and Deploy a new version to the Google Play"
2525
lane :deploy do
2626
#puts "Patch version for this build will be " + ENV["BUILD_NUMBER"]
2727
gradle(

model/build.gradle

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
import org.apache.tools.ant.taskdefs.condition.Os
22

3-
apply plugin: "java-library"
4-
apply plugin: "com.google.protobuf"
5-
apply plugin: "maven-publish"
3+
plugins {
4+
id 'java-library'
5+
id 'com.google.protobuf'
6+
id 'maven-publish'
7+
}
68

79
def archSuffix = Os.isFamily(Os.FAMILY_MAC) ? ':osx-x86_64' : ''
810

911
version = '0.0.1'
1012
group = 'com.codeinc.gen'
1113

12-
buildscript {
13-
repositories {
14-
mavenCentral()
15-
}
16-
dependencies {
17-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
18-
}
19-
}
20-
2114
def grpcVersion = "1.49.0"
2215
def protocVersion = "3.12.0"
2316
dependencies {
@@ -30,14 +23,14 @@ dependencies {
3023

3124
// Kotlin Generation
3225
implementation "io.grpc:grpc-kotlin-stub-lite:1.0.0"
33-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
26+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3"
3427
implementation 'javax.annotation:javax.annotation-api:1.3.2'
3528

3629
}
3730

38-
def generatedSrcRoot = file("${buildDir}/generated/source/proto/main/java")
39-
def generatedSrcRoot2 = file("${buildDir}/generated/source/proto/main/grpc")
40-
def generatedSrcRoot3 = file("${buildDir}/generated/source/proto/main/grpcKt")
31+
def generatedSrcRoot = file("${layout.buildDirectory}/generated/source/proto/main/java")
32+
def generatedSrcRoot2 = file("${layout.buildDirectory}/generated/source/proto/main/grpc")
33+
def generatedSrcRoot3 = file("${layout.buildDirectory}/generated/source/proto/main/grpcKt")
4134
sourceSets.main {
4235
proto {
4336
srcDir "${rootDir}/model/proto"
@@ -48,7 +41,7 @@ sourceSets.main {
4841
}
4942

5043
compileJava {
51-
options.annotationProcessorGeneratedSourcesDirectory generatedSrcRoot
44+
options.generatedSourceOutputDirectory.set(generatedSrcRoot)
5245
}
5346

5447
protobuf {
@@ -94,7 +87,7 @@ jar {
9487
exclude "**/*agora*/**"
9588
}
9689

97-
task sourcesJar(type: Jar) {
90+
tasks.register('sourcesJar', Jar) {
9891
from sourceSets.main.allSource
9992
archiveClassifier = 'sources'
10093
from generatedSrcRoot, generatedSrcRoot2, generatedSrcRoot3

0 commit comments

Comments
 (0)