Skip to content
Merged
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
37 changes: 8 additions & 29 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- uses: actions/setup-java@v3
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "zulu"
java-version: "17"
- name: Restore gradle.properties
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_KEY_RING_FILE: ${{ secrets.SIGNING_KEY_RING_FILE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_URL: ${{ secrets.SONATYPE_URL }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
shell: bash
run: |
mkdir -p ~/.gradle/
echo signing.keyId=${SIGNING_KEY_ID} >> ~/.gradle/gradle.properties
echo signing.password=${SIGNING_KEY_PASSWORD} >> ~/.gradle/gradle.properties
echo signing.secretKeyRingFile=${SIGNING_KEY_RING_FILE} >> ~/.gradle/gradle.properties
echo sonatypePassword=${SONATYPE_PASSWORD} >> ~/.gradle/gradle.properties
echo sonatypeUrl=${SONATYPE_URL} >> ~/.gradle/gradle.properties
echo sonatypeUsername=${SONATYPE_USERNAME} >> ~/.gradle/gradle.properties
cat ~/.gradle/gradle.properties
- name: Run lint checks on entire project
run: ./gradlew ktfmtCheck
- name: Unit test the library module
run: ./gradlew :lighthouse:test
- name: Build release version of library
run: ./gradlew :lighthouse:assembleRelease
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build everything
run: ./gradlew build
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.compiler)
alias(libs.plugins.ktfmt)
}

Expand Down
14 changes: 0 additions & 14 deletions buildSrc/build.gradle.kts

This file was deleted.

8 changes: 0 additions & 8 deletions buildSrc/settings.gradle.kts

This file was deleted.

28 changes: 0 additions & 28 deletions buildSrc/src/main/kotlin/Extensions.kt

This file was deleted.

175 changes: 0 additions & 175 deletions buildSrc/src/main/kotlin/Projects.kt

This file was deleted.

40 changes: 35 additions & 5 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
import lighthouse.setupDemoModule
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
}

setupDemoModule(name = "com.ivanempire.lighthouse.demo")
android {
namespace = "com.ivanempire.demo"
compileSdk = 36

defaultConfig {
applicationId = "com.ivanempire.demo"
minSdk = 26
targetSdk = 36
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures { compose = true }

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } }
}

dependencies {
// Core Android libraries
implementation(libs.androidx.core)
implementation(libs.androidx.runtime)

// Compose libraries
implementation(platform("androidx.compose:compose-bom:2023.01.00"))
implementation(platform(libs.compose.bom))
implementation(libs.material3)

// Compose integration with activities
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.Lighthouse">
<activity
android:name=".MainActivity"
android:name="com.ivanempire.lighthouse.demo.MainActivity"
android:exported="true"
android:theme="@style/Theme.Lighthouse">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableLongStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
Expand Down Expand Up @@ -107,11 +108,11 @@ class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DeviceListItem(device: AbridgedMediaDevice) {
var currentTime by remember { mutableStateOf(System.currentTimeMillis()) }
var currentTime by remember { mutableLongStateOf(System.currentTimeMillis()) }
val ttl = device.cache - (currentTime - device.latestTimestamp) / 1000
ListItem(
headlineText = { Text(device.location.toString()) },
supportingText = { Text(device.uuid) },
headlineContent = { Text(device.location.toString()) },
supportingContent = { Text(device.uuid) },
trailingContent = { Text(ttl.toString()) },
)
LaunchedEffect(Unit) {
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ kotlin.code.style=official
systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false

# Project setup
minSdk=21
targetSdk=34
compileSdk=34
# TODO: Drop back to 21 later, it's pulling in navigationevent
minSdk=23
targetSdk=36
compileSdk=36

# POM coordinates
POM_VERSION=2.1.1
Expand Down
Loading