Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://editorconfig.org/
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
16 changes: 9 additions & 7 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
# Push on main and release tags
push:
branches:
- 'main'
- "main"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"

# PR
pull_request:
branches:
- 'main'
- "main"

# Manual trigger
workflow_dispatch:
Expand All @@ -21,7 +21,6 @@ concurrency:
cancel-in-progress: true

jobs:

build:
name: CI/CD
runs-on: ubuntu-latest
Expand All @@ -34,9 +33,9 @@ jobs:
id: java
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
distribution: "temurin"
java-version: "17"
cache: "gradle"

- name: Check if main repo
id: is_main_repo
Expand All @@ -45,6 +44,9 @@ jobs:
echo "value=true" >> $GITHUB_OUTPUT
fi

- name: Run Spotless check
run: ./gradlew spotlessCheck

- name: Run assemble
if: ${{ !steps.is_main_repo.outputs.value || github.event_name == 'pull_request' }}
run: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
VERSION_INCREMENT:
description: 'The version number part to increment (major.minor.patch)'
description: "The version number part to increment (major.minor.patch)"
default: Minor
type: choice
options:
Expand All @@ -14,32 +14,32 @@ on:
- Patch
required: false
VERSION_OVERRIDE:
description: 'Version override (when not incrementing the previous version)'
description: "Version override (when not incrementing the previous version)"
type: string
required: false


permissions:
actions: write
contents: write

jobs:

build:
name: Release
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up JDK 17 and gradle cache
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
distribution: "temurin"
java-version: "17"
cache: "gradle"

- name: Run Spotless check
run: ./gradlew spotlessCheck

- name: Run release
id: release
Expand Down
242 changes: 121 additions & 121 deletions GenericApp/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,155 +1,155 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.google.services)
id 'maven-publish'
id 'signing'
alias(libs.plugins.android.application)
alias(libs.plugins.google.services)
id 'maven-publish'
id 'signing'
}

android {
defaultConfig {
applicationId = "io.openremote.app"
minSdk = 25
compileSdk = 37
targetSdk = 37
versionCode = 47
versionName = version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

resValue "string", "NOTIFICATION_CHANNEL_ID", applicationId + ".ORAppMessage"
}

if (project.hasProperty("keystoreFile")) {
signingConfigs {
release {
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
storeFile file(keystoreFile)
storePassword keystorePassword
}
}
defaultConfig {
applicationId = "io.openremote.app"
minSdk = 25
compileSdk = 37
targetSdk = 37
versionCode = 47
versionName = version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

resValue "string", "NOTIFICATION_CHANNEL_ID", applicationId + ".ORAppMessage"
}

if (project.hasProperty("keystoreFile")) {
signingConfigs {
release {
keyAlias keystoreKeyAlias
keyPassword keystoreKeyPassword
storeFile file(keystoreFile)
storePassword keystorePassword
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
if (project.hasProperty("keystoreFile")) {
signingConfig signingConfigs.release
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
if (project.hasProperty("keystoreFile")) {
signingConfig signingConfigs.release
}
}
}

buildFeatures {
viewBinding = true
resValues = true
}
buildFeatures {
viewBinding = true
resValues = true
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

namespace = 'io.openremote.app'
namespace = 'io.openremote.app'

publishing {
singleVariant('release') {
}
publishing {
singleVariant('release') {
}
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation libs.androidx.core.ktx
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.preference.ktx
implementation libs.play.services.location
implementation libs.jackson.module.kotlin
implementation platform(libs.firebase.bom)
implementation libs.firebase.messaging
implementation libs.material
implementation project(':ORLib')

// Unit testing framework
testImplementation libs.junit
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation libs.androidx.core.ktx
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.preference.ktx
implementation libs.play.services.location
implementation libs.jackson.module.kotlin
implementation platform(libs.firebase.bom)
implementation libs.firebase.messaging
implementation libs.material
implementation project(':ORLib')

// Unit testing framework
testImplementation libs.junit
}

tasks.register('sourcesJar', Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
archiveClassifier = 'sources'
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release

artifact source: file('build/outputs/apk/release/app-release.apk')
artifact sourcesJar

group = "io.openremote"
artifactId = "app"

pom {
name = 'OpenRemote Android Console'
description = 'Provides the Android OpenRemote Console Application'
url = 'https://github.com/openremote/console-android'
licenses {
license {
name = 'GNU Affero General Public License v3.0'
url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
}
}
developers {
developer {
id = 'developers'
name = 'Developers'
email = 'developers@openremote.io'
organization = 'OpenRemote'
organizationUrl = 'https://openremote.io'
}
}
scm {
connection = 'scm:git:git://github.com/openremote/console-android.git'
developerConnection = 'scm:git:ssh://github.com:openremote/console-android.git'
url = 'https://github.com/openremote/console-android/tree/main'
}
}
publishing {
publications {
release(MavenPublication) {
from components.release

artifact source: file('build/outputs/apk/release/app-release.apk')
artifact sourcesJar

group = "io.openremote"
artifactId = "app"

pom {
name = 'OpenRemote Android Console'
description = 'Provides the Android OpenRemote Console Application'
url = 'https://github.com/openremote/console-android'
licenses {
license {
name = 'GNU Affero General Public License v3.0'
url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
}
}

repositories {
maven {
if (!version.endsWith('-LOCAL')) {
credentials {
username = findProperty("publishUsername")
password = findProperty("publishPassword")
}
}
url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl")
}
developers {
developer {
id = 'developers'
name = 'Developers'
email = 'developers@openremote.io'
organization = 'OpenRemote'
organizationUrl = 'https://openremote.io'
}
}
scm {
connection = 'scm:git:git://github.com/openremote/console-android.git'
developerConnection = 'scm:git:ssh://github.com:openremote/console-android.git'
url = 'https://github.com/openremote/console-android/tree/main'
}
}
}
}

signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
if (signingKey && signingPassword) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
signReleasePublication.dependsOn(packageRelease)
repositories {
maven {
if (!version.endsWith('-LOCAL')) {
credentials {
username = findProperty("publishUsername")
password = findProperty("publishPassword")
}
}
url = version.endsWith('-LOCAL') ? layout.buildDirectory.dir('repo') : version.endsWith('-SNAPSHOT') ? findProperty("snapshotsRepoUrl") : findProperty("releasesRepoUrl")
}
}
}

signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
if (signingKey && signingPassword) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
signReleasePublication.dependsOn(packageRelease)
}
}

publishReleasePublicationToMavenLocal.dependsOn(packageRelease)
publishReleasePublicationToMavenLocal.dependsOn(packageRelease)
}
2 changes: 1 addition & 1 deletion GenericApp/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
}
],
"configuration_version": "1"
}
}
Loading
Loading