|
1 | 1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
2 | 2 |
|
3 | 3 | plugins { |
4 | | - alias(libs.plugins.android.application) |
5 | | - alias(libs.plugins.google.services) |
6 | | - id 'maven-publish' |
7 | | - id 'signing' |
| 4 | + alias(libs.plugins.android.application) |
| 5 | + alias(libs.plugins.google.services) |
| 6 | + id 'maven-publish' |
| 7 | + id 'signing' |
8 | 8 | } |
9 | 9 |
|
10 | 10 | android { |
11 | | - defaultConfig { |
12 | | - applicationId = "io.openremote.app" |
13 | | - minSdk = 25 |
14 | | - compileSdk = 37 |
15 | | - targetSdk = 37 |
16 | | - versionCode = 47 |
17 | | - versionName = version |
18 | | - |
19 | | - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
20 | | - |
21 | | - resValue "string", "NOTIFICATION_CHANNEL_ID", applicationId + ".ORAppMessage" |
22 | | - } |
23 | | - |
24 | | - if (project.hasProperty("keystoreFile")) { |
25 | | - signingConfigs { |
26 | | - release { |
27 | | - keyAlias keystoreKeyAlias |
28 | | - keyPassword keystoreKeyPassword |
29 | | - storeFile file(keystoreFile) |
30 | | - storePassword keystorePassword |
31 | | - } |
32 | | - } |
| 11 | + defaultConfig { |
| 12 | + applicationId = "io.openremote.app" |
| 13 | + minSdk = 25 |
| 14 | + compileSdk = 37 |
| 15 | + targetSdk = 37 |
| 16 | + versionCode = 47 |
| 17 | + versionName = version |
| 18 | + |
| 19 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 20 | + |
| 21 | + resValue "string", "NOTIFICATION_CHANNEL_ID", applicationId + ".ORAppMessage" |
| 22 | + } |
| 23 | + |
| 24 | + if (project.hasProperty("keystoreFile")) { |
| 25 | + signingConfigs { |
| 26 | + release { |
| 27 | + keyAlias keystoreKeyAlias |
| 28 | + keyPassword keystoreKeyPassword |
| 29 | + storeFile file(keystoreFile) |
| 30 | + storePassword keystorePassword |
| 31 | + } |
33 | 32 | } |
34 | | - |
35 | | - buildTypes { |
36 | | - release { |
37 | | - minifyEnabled false |
38 | | - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
39 | | - if (project.hasProperty("keystoreFile")) { |
40 | | - signingConfig signingConfigs.release |
41 | | - } |
42 | | - } |
| 33 | + } |
| 34 | + |
| 35 | + buildTypes { |
| 36 | + release { |
| 37 | + minifyEnabled false |
| 38 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| 39 | + if (project.hasProperty("keystoreFile")) { |
| 40 | + signingConfig signingConfigs.release |
| 41 | + } |
43 | 42 | } |
| 43 | + } |
44 | 44 |
|
45 | | - buildFeatures { |
46 | | - viewBinding = true |
47 | | - resValues = true |
48 | | - } |
| 45 | + buildFeatures { |
| 46 | + viewBinding = true |
| 47 | + resValues = true |
| 48 | + } |
49 | 49 |
|
50 | | - compileOptions { |
51 | | - sourceCompatibility = JavaVersion.VERSION_17 |
52 | | - targetCompatibility = JavaVersion.VERSION_17 |
53 | | - } |
| 50 | + compileOptions { |
| 51 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 52 | + targetCompatibility = JavaVersion.VERSION_17 |
| 53 | + } |
54 | 54 |
|
55 | | - namespace = 'io.openremote.app' |
| 55 | + namespace = 'io.openremote.app' |
56 | 56 |
|
57 | | - publishing { |
58 | | - singleVariant('release') { |
59 | | - } |
| 57 | + publishing { |
| 58 | + singleVariant('release') { |
60 | 59 | } |
| 60 | + } |
61 | 61 | } |
62 | 62 |
|
63 | 63 | kotlin { |
64 | | - compilerOptions { |
65 | | - jvmTarget.set(JvmTarget.JVM_17) |
66 | | - } |
| 64 | + compilerOptions { |
| 65 | + jvmTarget.set(JvmTarget.JVM_17) |
| 66 | + } |
67 | 67 | } |
68 | 68 |
|
69 | 69 | dependencies { |
70 | | - implementation fileTree(dir: "libs", include: ["*.jar"]) |
71 | | - implementation libs.androidx.core.ktx |
72 | | - implementation libs.androidx.appcompat |
73 | | - implementation libs.androidx.constraintlayout |
74 | | - implementation libs.androidx.preference.ktx |
75 | | - implementation libs.play.services.location |
76 | | - implementation libs.jackson.module.kotlin |
77 | | - implementation platform(libs.firebase.bom) |
78 | | - implementation libs.firebase.messaging |
79 | | - implementation libs.material |
80 | | - implementation project(':ORLib') |
81 | | - |
82 | | - // Unit testing framework |
83 | | - testImplementation libs.junit |
| 70 | + implementation fileTree(dir: "libs", include: ["*.jar"]) |
| 71 | + implementation libs.androidx.core.ktx |
| 72 | + implementation libs.androidx.appcompat |
| 73 | + implementation libs.androidx.constraintlayout |
| 74 | + implementation libs.androidx.preference.ktx |
| 75 | + implementation libs.play.services.location |
| 76 | + implementation libs.jackson.module.kotlin |
| 77 | + implementation platform(libs.firebase.bom) |
| 78 | + implementation libs.firebase.messaging |
| 79 | + implementation libs.material |
| 80 | + implementation project(':ORLib') |
| 81 | + |
| 82 | + // Unit testing framework |
| 83 | + testImplementation libs.junit |
84 | 84 | } |
85 | 85 |
|
86 | 86 | tasks.register('sourcesJar', Jar) { |
87 | | - from android.sourceSets.main.java.srcDirs |
88 | | - archiveClassifier = 'sources' |
| 87 | + from android.sourceSets.main.java.srcDirs |
| 88 | + archiveClassifier = 'sources' |
89 | 89 | } |
90 | 90 |
|
91 | 91 | afterEvaluate { |
92 | | - publishing { |
93 | | - publications { |
94 | | - release(MavenPublication) { |
95 | | - from components.release |
96 | | - |
97 | | - artifact source: file('build/outputs/apk/release/app-release.apk') |
98 | | - artifact sourcesJar |
99 | | - |
100 | | - group = "io.openremote" |
101 | | - artifactId = "app" |
102 | | - |
103 | | - pom { |
104 | | - name = 'OpenRemote Android Console' |
105 | | - description = 'Provides the Android OpenRemote Console Application' |
106 | | - url = 'https://github.com/openremote/console-android' |
107 | | - licenses { |
108 | | - license { |
109 | | - name = 'GNU Affero General Public License v3.0' |
110 | | - url = 'https://www.gnu.org/licenses/agpl-3.0.en.html' |
111 | | - } |
112 | | - } |
113 | | - developers { |
114 | | - developer { |
115 | | - id = 'developers' |
116 | | - name = 'Developers' |
117 | | - email = 'developers@openremote.io' |
118 | | - organization = 'OpenRemote' |
119 | | - organizationUrl = 'https://openremote.io' |
120 | | - } |
121 | | - } |
122 | | - scm { |
123 | | - connection = 'scm:git:git://github.com/openremote/console-android.git' |
124 | | - developerConnection = 'scm:git:ssh://github.com:openremote/console-android.git' |
125 | | - url = 'https://github.com/openremote/console-android/tree/main' |
126 | | - } |
127 | | - } |
| 92 | + publishing { |
| 93 | + publications { |
| 94 | + release(MavenPublication) { |
| 95 | + from components.release |
| 96 | + |
| 97 | + artifact source: file('build/outputs/apk/release/app-release.apk') |
| 98 | + artifact sourcesJar |
| 99 | + |
| 100 | + group = "io.openremote" |
| 101 | + artifactId = "app" |
| 102 | + |
| 103 | + pom { |
| 104 | + name = 'OpenRemote Android Console' |
| 105 | + description = 'Provides the Android OpenRemote Console Application' |
| 106 | + url = 'https://github.com/openremote/console-android' |
| 107 | + licenses { |
| 108 | + license { |
| 109 | + name = 'GNU Affero General Public License v3.0' |
| 110 | + url = 'https://www.gnu.org/licenses/agpl-3.0.en.html' |
128 | 111 | } |
129 | | - } |
130 | | - |
131 | | - repositories { |
132 | | - maven { |
133 | | - if (!version.endsWith('-LOCAL')) { |
134 | | - credentials { |
135 | | - username = findProperty("publishUsername") |
136 | | - password = findProperty("publishPassword") |
137 | | - } |
138 | | - } |
139 | | - url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl") |
| 112 | + } |
| 113 | + developers { |
| 114 | + developer { |
| 115 | + id = 'developers' |
| 116 | + name = 'Developers' |
| 117 | + email = 'developers@openremote.io' |
| 118 | + organization = 'OpenRemote' |
| 119 | + organizationUrl = 'https://openremote.io' |
140 | 120 | } |
| 121 | + } |
| 122 | + scm { |
| 123 | + connection = 'scm:git:git://github.com/openremote/console-android.git' |
| 124 | + developerConnection = 'scm:git:ssh://github.com:openremote/console-android.git' |
| 125 | + url = 'https://github.com/openremote/console-android/tree/main' |
| 126 | + } |
141 | 127 | } |
| 128 | + } |
142 | 129 | } |
143 | 130 |
|
144 | | - signing { |
145 | | - def signingKey = findProperty("signingKey") |
146 | | - def signingPassword = findProperty("signingPassword") |
147 | | - if (signingKey && signingPassword) { |
148 | | - useInMemoryPgpKeys(signingKey, signingPassword) |
149 | | - sign publishing.publications |
150 | | - signReleasePublication.dependsOn(packageRelease) |
| 131 | + repositories { |
| 132 | + maven { |
| 133 | + if (!version.endsWith('-LOCAL')) { |
| 134 | + credentials { |
| 135 | + username = findProperty("publishUsername") |
| 136 | + password = findProperty("publishPassword") |
| 137 | + } |
151 | 138 | } |
| 139 | + url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl") |
| 140 | + } |
| 141 | + } |
| 142 | + } |
| 143 | + |
| 144 | + signing { |
| 145 | + def signingKey = findProperty("signingKey") |
| 146 | + def signingPassword = findProperty("signingPassword") |
| 147 | + if (signingKey && signingPassword) { |
| 148 | + useInMemoryPgpKeys(signingKey, signingPassword) |
| 149 | + sign publishing.publications |
| 150 | + signReleasePublication.dependsOn(packageRelease) |
152 | 151 | } |
| 152 | + } |
153 | 153 |
|
154 | | - publishReleasePublicationToMavenLocal.dependsOn(packageRelease) |
| 154 | + publishReleasePublicationToMavenLocal.dependsOn(packageRelease) |
155 | 155 | } |
0 commit comments