Skip to content

Commit 0bc7db6

Browse files
michaelbelclaude
andcommitted
Rename package to constraintlayout, update Gradle to 9.5.0, update .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b26f300 commit 0bc7db6

20 files changed

Lines changed: 495 additions & 0 deletions

.github/codeowners

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @michaelbel

.github/debug-key.jks

2.66 KB
Binary file not shown.

.github/funding.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
custom: [
2+
boosty.to/michaelbel,
3+
tbank.ru/cf/5YrkxI1CsmO,
4+
https://pay.cloudtips.ru/p/fce67f60,
5+
https://yoomoney.ru/fundraise/1CSMJ5M9RKB.250919
6+
]

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
pull_request:
8+
paths-ignore:
9+
- '**.md'
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: environment-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
job-common:
18+
runs-on: ubuntu-24.04
19+
outputs:
20+
SHORT_SHA: ${{ steps.expose_sha.outputs.short_sha }}
21+
steps:
22+
- name: expose short commit sha
23+
id: expose_sha
24+
run: |
25+
SHORT_SHA=${GITHUB_SHA::7}
26+
echo "short_sha=$SHORT_SHA" >> $GITHUB_ENV
27+
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT
28+
29+
build-android:
30+
needs: job-common
31+
runs-on: ubuntu-24.04
32+
timeout-minutes: 60
33+
env:
34+
SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }}
35+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
36+
steps:
37+
- name: checkout repo
38+
uses: actions/checkout@v5
39+
with:
40+
fetch-depth: 0
41+
42+
- name: setup jdk 21
43+
uses: actions/setup-java@v5
44+
with:
45+
distribution: 'temurin'
46+
java-version: '21'
47+
48+
- name: cache gradle dependencies
49+
uses: actions/cache@v5
50+
with:
51+
path: ~/.gradle/caches
52+
key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }}
53+
restore-keys: |
54+
gradle-${{ runner.os }}-
55+
56+
- name: cache gradle wrapper
57+
uses: actions/cache@v5
58+
with:
59+
path: ~/.gradle/wrapper
60+
key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
61+
62+
- name: clean outputs directory
63+
run: rm -rf app/build/outputs/*
64+
65+
- name: make gradlew executable
66+
run: chmod +x ./gradlew
67+
68+
- name: assemble debug artifact
69+
run: ./gradlew assembleDebug
70+
71+
- name: upload artifacts to outputs
72+
uses: actions/upload-artifact@v6
73+
with:
74+
path: |
75+
app/build/outputs/apk
76+
77+
- name: expose version
78+
id: version
79+
run: ./gradlew -q printVersion | tee -a $GITHUB_ENV | tee -a $GITHUB_OUTPUT
80+
81+
- name: expose apk path
82+
run: |
83+
echo "APK_PATH=$(find app/build/outputs/apk -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV
84+
85+
- name: telegram notify
86+
env:
87+
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
88+
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
89+
THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }}
90+
MESSAGE: |
91+
✅ *${{ env.VERSION_NAME }} (${{ env.VERSION_CODE }})*
92+
*Repo:* [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }})
93+
*Branch:* [${{ github.ref_name }}](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }})
94+
*Commit:* [${{ env.SHORT_SHA }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
95+
run: |
96+
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \
97+
-F chat_id="${CHAT_ID}" \
98+
-F document="@${{ env.APK_PATH }}" \
99+
-F caption="${{ env.MESSAGE }}" \
100+
-F message_thread_id="${THREAD_ID}" \
101+
-F parse_mode="Markdown"

agents.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Agent Guidelines
2+
3+
- Scope: entire repository.
4+
- Prefer running `./gradlew test` after making changes that affect application behavior.
5+
- Follow existing Kotlin and Gradle conventions; keep documentation concise and in markdown.
6+
- Avoid adding unnecessary dependencies or tools without justification.

app/build.gradle.kts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import java.nio.charset.StandardCharsets
2+
3+
plugins {
4+
alias(libs.plugins.android.application)
5+
alias(libs.plugins.kotlin.compose)
6+
}
7+
8+
private val gitCommitsCount: Int by lazy {
9+
try {
10+
val isWindows = System.getProperty("os.name").contains("Windows", ignoreCase = true)
11+
val processBuilder = when {
12+
isWindows -> ProcessBuilder("cmd", "/c", "git", "rev-list", "--count", "HEAD")
13+
else -> ProcessBuilder("git", "rev-list", "--count", "HEAD")
14+
}
15+
processBuilder.redirectErrorStream(true)
16+
processBuilder.start().inputStream.bufferedReader(StandardCharsets.UTF_8).readLine().trim().toInt()
17+
} catch (_: Exception) {
18+
1
19+
}
20+
}
21+
22+
kotlin {
23+
jvmToolchain(libs.versions.jdk.get().toInt())
24+
}
25+
26+
android {
27+
namespace = "org.michaelbel.constraintlayout"
28+
compileSdk = libs.versions.compile.sdk.get().toInt()
29+
30+
defaultConfig {
31+
applicationId = "org.michaelbel.constraintlayout"
32+
minSdk = libs.versions.min.sdk.get().toInt()
33+
targetSdk = libs.versions.target.sdk.get().toInt()
34+
versionCode = gitCommitsCount
35+
versionName = "1.0.0"
36+
}
37+
38+
signingConfigs {
39+
getByName("debug") {
40+
keyAlias = "myapplication"
41+
keyPassword = "password"
42+
storeFile = rootProject.file(".github/debug-key.jks")
43+
storePassword = "password"
44+
}
45+
}
46+
47+
buildTypes {
48+
debug {
49+
signingConfig = signingConfigs.getByName("debug")
50+
}
51+
}
52+
53+
buildFeatures {
54+
compose = true
55+
}
56+
}
57+
58+
base {
59+
archivesName.set("MyApplication-v${android.defaultConfig.versionName}(${android.defaultConfig.versionCode})")
60+
}
61+
62+
dependencies {
63+
implementation(libs.google.material)
64+
implementation(libs.androidx.activity.compose)
65+
implementation(libs.androidx.compose.material3)
66+
implementation(libs.androidx.compose.ui.tooling)
67+
implementation(libs.androidx.core.splashscreen)
68+
}
69+
70+
tasks.register("printVersion") {
71+
doLast {
72+
println("VERSION_NAME=${android.defaultConfig.versionName}")
73+
println("VERSION_CODE=${android.defaultConfig.versionCode}")
74+
}
75+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.michaelbel.constraintlayout
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.activity.enableEdgeToEdge
7+
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
8+
import org.michaelbel.constraintlayout.ui.AppTheme
9+
10+
class MainActivity: ComponentActivity() {
11+
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
installSplashScreen()
14+
super.onCreate(savedInstanceState)
15+
enableEdgeToEdge()
16+
setContent { AppTheme { MainActivityContent() } }
17+
}
18+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@file:OptIn(ExperimentalMaterial3Api::class)
2+
3+
package org.michaelbel.constraintlayout
4+
5+
import androidx.compose.foundation.layout.Arrangement
6+
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.compose.foundation.lazy.LazyColumn
8+
import androidx.compose.material3.ExperimentalMaterial3Api
9+
import androidx.compose.material3.Scaffold
10+
import androidx.compose.material3.Text
11+
import androidx.compose.material3.TopAppBar
12+
import androidx.compose.runtime.Composable
13+
import androidx.compose.ui.Alignment
14+
import androidx.compose.ui.Modifier
15+
import androidx.compose.ui.res.stringResource
16+
17+
@Composable
18+
fun MainActivityContent() {
19+
Scaffold(
20+
modifier = Modifier.fillMaxSize(),
21+
topBar = {
22+
TopAppBar(
23+
title = {
24+
Text(
25+
text = stringResource(R.string.app_name)
26+
)
27+
}
28+
)
29+
}
30+
) { innerPadding ->
31+
LazyColumn(
32+
modifier = Modifier.fillMaxSize(),
33+
contentPadding = innerPadding,
34+
verticalArrangement = Arrangement.Center,
35+
horizontalAlignment = Alignment.CenterHorizontally
36+
) {
37+
item {
38+
Text(
39+
text = "Hello Android!"
40+
)
41+
}
42+
}
43+
}
44+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.michaelbel.constraintlayout.ui
2+
3+
import androidx.compose.foundation.isSystemInDarkTheme
4+
import androidx.compose.material3.MaterialTheme
5+
import androidx.compose.material3.darkColorScheme
6+
import androidx.compose.material3.lightColorScheme
7+
import androidx.compose.runtime.Composable
8+
9+
@Composable
10+
fun AppTheme(
11+
content: @Composable () -> Unit
12+
) {
13+
MaterialTheme(
14+
colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme(),
15+
content = content
16+
)
17+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@drawable/ic_launcher_background" />
4+
<foreground android:drawable="@drawable/ic_launcher_foreground" />
5+
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
6+
</adaptive-icon>

0 commit comments

Comments
 (0)