11import 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
79def archSuffix = Os . isFamily(Os . FAMILY_MAC ) ? ' :osx-x86_64' : ' '
810
911version = ' 0.0.1'
1012group = ' 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-
2114def grpcVersion = " 1.49.0"
2215def protocVersion = " 3.12.0"
2316dependencies {
@@ -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" )
4134sourceSets. main {
4235 proto {
4336 srcDir " ${ rootDir} /model/proto"
@@ -48,7 +41,7 @@ sourceSets.main {
4841}
4942
5043compileJava {
51- options. annotationProcessorGeneratedSourcesDirectory generatedSrcRoot
44+ options. generatedSourceOutputDirectory . set( generatedSrcRoot)
5245}
5346
5447protobuf {
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