-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
73 lines (65 loc) · 2.16 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
buildscript {
ext.kotlin_version = '1.5.10'
ext.flipper_version = '0.95.0'
ext.retrofit_version = '2.9.0'
ext.protobuf_version = '3.17.1'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.16'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.16.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.32'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.39.0'
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.38.0'
id 'org.jlleitschuh.gradle.ktlint' version '10.0.0'
id 'io.gitlab.arturbosch.detekt' version '1.17.1'
}
tasks.detekt.jvmTarget = "1.8"
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = true // activate all available (even unstable) rules.
reports {
html.enabled = true // observe findings in your browser with structure and code snippets
xml.enabled = true // checkstyle like format mainly for integrations like Jenkins
}
}
allprojects {
repositories {
google()
mavenCentral()
}
project.ext {
desktopIP="\"${getLocalIPv4()[0]}\""
}
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
}
}
}
def getLocalIPv4() {
def ip4s = []
NetworkInterface.getNetworkInterfaces()
.findAll { it.isUp() && !it.isLoopback() && !it.isVirtual() }
.each {
it.getInetAddresses()
.findAll { !it.isLoopbackAddress() && it instanceof Inet4Address }
.each { ip4s << it.getHostAddress() }
}
return ip4s
}
task addKtLintStyle(type: JavaExec, group: "formatting") {
description = "Adds The KtLint Style To Your IDE"
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "--android", "applyToIDEA", "-y"
//Point to the root directory because this task needs access to the .idea directory
workingDir(getRootDir())
}