Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1aad772
chore: add devcontainer configuration for Java development
ArthurKun21 Jan 29, 2026
0194913
chore: update devcontainer configuration for Java + Android
ArthurKun21 Jan 29, 2026
2df0f15
chore: add Dockerfile for Java + Android development environment
ArthurKun21 Jan 29, 2026
a40ef3e
chore: update Android Command Line Tools and SDK components in Docker…
ArthurKun21 Jan 29, 2026
12d3ed0
chore: update Dockerfile to improve Android SDK installation process
ArthurKun21 Jan 29, 2026
c4855d0
chore: update Dockerfile and devcontainer.json for improved Android S…
ArthurKun21 Jan 29, 2026
e8b0918
chore: remove yarn repository to avoid GPG key errors in Dockerfile
ArthurKun21 Jan 29, 2026
0209daa
chore: update Gradle wrapper to version 9.3.0
ArthurKun21 Jan 29, 2026
1170c02
chore(deps): bump hilt from 2.58 to 2.59 and ksp from 2.3.4 to 2.3.5
ArthurKun21 Jan 29, 2026
7ed808c
chore(deps): bump compose-bom from 2026.01.00 to 2026.01.01
ArthurKun21 Jan 29, 2026
ff5b9d2
chore(deps): bump agp from 8.13.2 to 9.0.0
ArthurKun21 Jan 29, 2026
a2e4825
chore: initial changes to agp 9.0
ArthurKun21 Jan 29, 2026
94a4bca
chore: add import for LibrariesForLibs in lint configuration
ArthurKun21 Jan 29, 2026
e0e8692
chore: update JavaVersion and JvmTarget to version 17
ArthurKun21 Jan 29, 2026
96ca2df
chore: remove unnecessary blank line in build.gradle.kts
ArthurKun21 Jan 29, 2026
d6c8e99
chore: remove Chinese README file
ArthurKun21 Jan 29, 2026
64c3321
docs: update README with correct repository links and remove outdated…
ArthurKun21 Jan 29, 2026
b924b74
docs: update README to clarify dependency import instructions and imp…
ArthurKun21 Jan 29, 2026
b669b08
ci: update workflows to ignore .devcontainer directory
ArthurKun21 Jan 29, 2026
760a94b
chore(deps): bump spotless from 8.1.0 to 8.2.1
ArthurKun21 Jan 29, 2026
82c2f2c
chore(deps): remove kotlin-metadata dependency due to compatibility i…
ArthurKun21 Jan 29, 2026
cd8f252
chore: remove compose build feature from sample projects
ArthurKun21 Jan 29, 2026
2abb3d4
chore: update packaging configuration to exclude specific resource files
ArthurKun21 Jan 29, 2026
f4af4ae
chore: add library tests plugin and reorganize test dependencies
ArthurKun21 Jan 29, 2026
0fc9a97
chore: add android tests plugin and configure test dependencies
ArthurKun21 Jan 29, 2026
0353d1b
chore: add sample.common.deps plugin and consolidate dependencies in …
ArthurKun21 Jan 29, 2026
95045e2
chore: enable compose build features and update packaging configuration
ArthurKun21 Jan 29, 2026
8192953
chore: remove vscjava.vscode-java-pack extension from devcontainer co…
ArthurKun21 Jan 29, 2026
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
44 changes: 44 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM mcr.microsoft.com/devcontainers/java:17-bookworm

# Always start as root for provisioning
USER root
ENV DEBIAN_FRONTEND=noninteractive

# ---- System dependencies ----
# Remove yarn repository to avoid GPG key errors
RUN rm -f /etc/apt/sources.list.d/yarn.list \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
unzip \
zip \
libglu1-mesa \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# ---- Android SDK env ----
ENV ANDROID_SDK_ROOT=/usr/local/android-sdk
ENV ANDROID_HOME=${ANDROID_SDK_ROOT}
ENV PATH=${PATH}:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools

# ---- Android command line tools ----
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& curl -fsSL https://dl.google.com/android/repository/commandlinetools-linux-14742923_latest.zip -o /tmp/cmdline-tools.zip \
&& unzip /tmp/cmdline-tools.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools \
&& mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest \
&& rm /tmp/cmdline-tools.zip

# ---- SDK packages ----
RUN yes | sdkmanager --licenses \
&& sdkmanager --update \
&& sdkmanager \
"platform-tools" \
"platforms;android-36" \
"build-tools;36.0.0"

# ---- Permissions (CRITICAL) ----
RUN chown -R vscode:vscode ${ANDROID_SDK_ROOT}

# Drop privileges
USER vscode
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Java + Android",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installGradle": true
}
},
"customizations": {
"vscode": {
"extensions": [
"GitHub.copilot",
"oderwat.indent-rainbow",
"redhat.vscode-yaml",
"vscjava.vscode-java-pack"
]
}
},
"remoteUser": "vscode"
}
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
.gradle
/local.properties
.DS_Store
/build
build
.kotlin
/captures
.externalNativeBuild
.cxx
Expand All @@ -11,5 +12,3 @@ local.properties
# Ignore all files in the .idea directory except for name
.idea/*
!.idea/.name

.kotlin/*
24 changes: 0 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,14 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.agp) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.spotless) apply false
}

subprojects {
apply(plugin = "com.diffplug.spotless")
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt", "**/*.kts")
targetExclude("**/build/**/*.kt")
ktlint(libs.ktlint.core.get().version).editorConfigOverride(
mapOf(
"ktlint_standard_annotation" to "disabled",
),
)
trimTrailingWhitespace()
endWithNewline()
}
format("xml") {
target("**/*.xml")
trimTrailingWhitespace()
endWithNewline()
}
}
}
20 changes: 20 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
mavenCentral()
google()
}

dependencies {
implementation(libs.androidx.gradle)
implementation(libs.kotlin.gradle)
implementation(libs.compose.compiler.gradle)
implementation(libs.spotless.gradle)
implementation(gradleApi())

// workaround to enable version catalogs (libs) in buildSrc
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
9 changes: 9 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}

rootProject.name = "ComposeFloatingWindow-buildSrc"
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/android.application.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import buildlogic.AndroidConfig
import buildlogic.configureAndroid

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.plugin.compose")
id("code.lint")
}

android {
defaultConfig {
targetSdk = AndroidConfig.TARGET_SDK
}
configureAndroid(this)
}
14 changes: 14 additions & 0 deletions buildSrc/src/main/kotlin/buildLogic/AndroidConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package buildlogic

import org.gradle.api.JavaVersion as GradleJavaVersion
import org.jetbrains.kotlin.gradle.dsl.JvmTarget as KotlinJvmTarget

object AndroidConfig {
const val COMPILE_SDK = 36
const val TARGET_SDK = 36
const val MIN_SDK = 24

// https://youtrack.jetbrains.com/issue/KT-66995/JvmTarget-and-JavaVersion-compatibility-for-easier-JVM-version-setup
val JavaVersion = GradleJavaVersion.VERSION_17
val JvmTarget = KotlinJvmTarget.JVM_17
}
23 changes: 23 additions & 0 deletions buildSrc/src/main/kotlin/buildLogic/ProjectExtensions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package buildlogic

import com.android.build.api.dsl.CommonExtension
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Project
import org.gradle.kotlin.dsl.the

val Project.libs get() = the<LibrariesForLibs>()

internal fun configureAndroid(commonExtension: CommonExtension) {
commonExtension.apply {
compileSdk = AndroidConfig.COMPILE_SDK

defaultConfig.apply {
minSdk = AndroidConfig.MIN_SDK
}

compileOptions.apply {
sourceCompatibility = AndroidConfig.JavaVersion
targetCompatibility = AndroidConfig.JavaVersion
}
}
}
25 changes: 25 additions & 0 deletions buildSrc/src/main/kotlin/code.lint.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import org.gradle.accessors.dm.LibrariesForLibs

plugins {
id("com.diffplug.spotless")
}

val libs = the<LibrariesForLibs>()


spotless {
kotlin {
target("**/*.kt", "**/*.kts")
targetExclude("**/build/**/*.kt")
ktlint(libs.ktlint.core.get().version).editorConfigOverride(
mapOf("ktlint_standard_annotation" to "disabled")
)
trimTrailingWhitespace()
endWithNewline()
}
format("xml") {
target("**/*.xml")
trimTrailingWhitespace()
endWithNewline()
}
}
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/library.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import buildlogic.AndroidConfig
import buildlogic.configureAndroid

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.plugin.compose")
id("code.lint")
}

android {
defaultConfig {
lint.targetSdk = AndroidConfig.TARGET_SDK
}
configureAndroid(this)
}
18 changes: 14 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ compile-sdk = "36"
target-sdk = "36"
min-sdk = "24"

agp = "8.13.2"
agp = "9.0.0"
kotlin = "2.3.0"

android-core-ktx = "1.17.0"
appcompat = "1.7.1"
lifecycle = "2.10.0"
activity-compose = "1.12.2"

compose-bom = "2026.01.00"
compose-bom = "2026.01.01"

junit = "4.13.2"

Expand All @@ -22,8 +22,8 @@ google-material = "1.13.0"

leakcanary = "2.14"

hilt = "2.58"
ksp = "2.3.4"
hilt = "2.59"
ksp = "2.3.5"

datastore = "1.2.0"

Expand Down Expand Up @@ -68,6 +68,16 @@ ktlint-core = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlin

kotlin-metadata = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version = "2.3.0" }

#
# Gradle libraries
#

androidx-gradle = { module = "com.android.tools.build:gradle", version.ref = "agp" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
compose-compiler-gradle = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }

spotless-gradle = { group = "com.diffplug.spotless", name = "spotless-plugin-gradle", version.ref = "spotless" }

[plugins]
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
agp = { id = "com.android.application", version.ref = "agp" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
16 changes: 1 addition & 15 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
plugins {
id("com.android.library")
kotlin("android")
`maven-publish`
alias(libs.plugins.compose.compiler)
id("library")
}

android {
namespace = "com.github.only52607.compose.window"
compileSdk = libs.versions.compile.sdk.get().toInt()

defaultConfig {
minSdk = libs.versions.min.sdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
Expand All @@ -25,10 +15,6 @@ android {
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
}
Expand Down
11 changes: 1 addition & 10 deletions samples/app-activity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
plugins {
alias(libs.plugins.agp)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
id("android.application")
}

android {
namespace = "io.github.arthurkun.app.activity"
compileSdk = libs.versions.compile.sdk.get().toInt()

defaultConfig {
applicationId = "io.github.arthurkun.floating.window"
minSdk = libs.versions.min.sdk.get().toInt()
targetSdk = libs.versions.target.sdk.get().toInt()
versionCode = 1
versionName = "1.0"

Expand All @@ -28,10 +23,6 @@ android {
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
}
Expand Down
Loading