This repository has been archived by the owner on Oct 5, 2018. It is now read-only.
forked from davide-imbriaco/a-sync
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
87 lines (76 loc) · 2.39 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
buildscript {
ext.kotlin_version = '1.2.20'
repositories {
jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
}
}
allprojects {
apply plugin: 'maven'
apply plugin: 'com.github.ben-manes.versions'
group = "com.github.Nutomic"
version = "0.2.1"
}
subprojects {
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'com.google.protobuf'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileKotlin.kotlinOptions.jvmTarget = "1.6"
task sourceJar(type: Jar) {
group 'Build'
description 'An archive of the source code'
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourceJar
archives javadocJar
}
protobuf {
protoc {
// You still need protoc like in the non-Android case
//artifact = "com.google.protobuf:protoc:3.5.1-1"
}
plugins {
javalite {
// The codegen for lite comes as a separate artifact
artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
// In most cases you don't need the full Java output
// if you use the lite output.
remove java
}
task.plugins {
javalite { }
}
}
}
}
// Make sure Intellij can find generated protobuf files.
idea.module.sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/javalite")
// Workaround for https://github.com/google/protobuf-gradle-plugin/issues/100
compileKotlin.dependsOn('generateProto')
sourceSets.main.kotlin.srcDirs += file("${protobuf.generatedFilesBaseDir}/main/javalite")
repositories {
mavenLocal()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "com.google.protobuf:protobuf-lite:3.0.1"
}
}