forked from sqlcipher/sqlcipher-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
78 lines (72 loc) · 2.52 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
import groovy.text.SimpleTemplateEngine
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
def gradleToolsVersion = "7.4.1"
classpath "com.android.tools.build:gradle:${gradleToolsVersion}"
}
}
plugins {
id('maven-publish')
id('signing')
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
allprojects {
repositories {
mavenCentral()
google()
}
}
project.ext {
if(project.hasProperty('sqlcipherAndroidVersion') && "${sqlcipherAndroidVersion}") {
libraryVersion = "${sqlcipherAndroidVersion}"
} else {
libraryVersion = "4.6.0"
}
minSdkVersion = 21
androidXSQLiteVersion = "2.2.0"
roomVersion = "2.5.0"
androidNdkVersion = "25.2.9519653"
mavenLocalRepositoryPrefix = "file://"
if(project.hasProperty('publishLocal') && publishLocal.toBoolean()){
mavenSnapshotRepositoryUrl = "outputs/snapshot"
mavenReleaseRepositoryUrl = "outputs/release"
} else {
mavenLocalRepositoryPrefix = ""
mavenSnapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots"
mavenReleaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}
if(project.hasProperty('publishSnapshot') && publishSnapshot.toBoolean()){
mavenVersionName = "${libraryVersion}-SNAPSHOT"
} else {
mavenVersionName = "${libraryVersion}"
}
if(project.hasProperty('nexusUsername')){
nexusUsername = "${nexusUsername}"
}
if(project.hasProperty('nexusPassword')){
nexusPassword = "${nexusPassword}"
}
nexusUsername = project.hasProperty('nexusUsername') ? "${nexusUsername}" : ""
nexusPassword = project.hasProperty('nexusPassword') ? "${nexusPassword}" : ""
nexusStagingProfileId = project.hasProperty('nexusStagingProfileId') ? "${nexusStagingProfileId}" : ""
}
task generateReadMe {
def readme = new File("README.md")
def engine = new SimpleTemplateEngine()
def reader = new FileReader("README.md.template")
def binding = [
libraryVersion: project.ext.libraryVersion,
androidXSQLiteVersion: project.ext.androidXSQLiteVersion,
androidNdkVersion: project.ext.androidNdkVersion,
minSdkVersion: project.ext.minSdkVersion,
]
def template = engine.createTemplate(reader).make(binding)
readme.write(template.toString())
}
project.afterEvaluate {
build.dependsOn generateReadMe
}