![]() |
VOOZH | about |
dotnet add package GiantCroissant.Lunar.Build.Mobile.Android --version 0.1.1-ci.113
NuGet\Install-Package GiantCroissant.Lunar.Build.Mobile.Android -Version 0.1.1-ci.113
<PackageReference Include="GiantCroissant.Lunar.Build.Mobile.Android" Version="0.1.1-ci.113" />
<PackageVersion Include="GiantCroissant.Lunar.Build.Mobile.Android" Version="0.1.1-ci.113" />Directory.Packages.props
<PackageReference Include="GiantCroissant.Lunar.Build.Mobile.Android" />Project file
paket add GiantCroissant.Lunar.Build.Mobile.Android --version 0.1.1-ci.113
#r "nuget: GiantCroissant.Lunar.Build.Mobile.Android, 0.1.1-ci.113"
#:package GiantCroissant.Lunar.Build.Mobile.Android@0.1.1-ci.113
#addin nuget:?package=GiantCroissant.Lunar.Build.Mobile.Android&version=0.1.1-ci.113&prereleaseInstall as a Cake Addin
#tool nuget:?package=GiantCroissant.Lunar.Build.Mobile.Android&version=0.1.1-ci.113&prereleaseInstall as a Cake Tool
Complete Android build support with Gradle integration, signing, and deployment capabilities
The RFC020 Android Build Integration provides comprehensive Android build support following RFC018 Build Component Specification patterns. This component enables:
# Set required environment variables
export ANDROID_SDK_ROOT="/path/to/android-sdk"
export JAVA_HOME="/path/to/java-jdk-11"
export ANDROID_KEYSTORE_PASSWORD="your-keystore-password"
export ANDROID_KEY_ALIAS="your-key-alias"
export ANDROID_KEY_PASSWORD="your-key-password"
Add to your build-config.json:
{
"projectGroups": [
{
"name": "android-builds",
"buildType": "android-mobile",
"sourceDirectory": "android",
"outputs": [
{
"type": "android-apk",
"directory": "build/outputs/apk",
"destinations": ["artifacts", "firebase"]
},
{
"type": "android-aab",
"directory": "build/outputs/bundle",
"destinations": ["artifacts", "playstore"]
}
],
"configuration": {
"android": {
"enabled": true,
"gradlePath": "gradlew",
"projectPath": "./android",
"buildTypes": ["debug", "release", "staging"],
"productFlavors": ["demo", "full"],
"defaultBuildVariant": "demoDebug",
"targetSdkVersion": 33,
"minSdkVersion": 21,
"compileSdkVersion": 33,
"buildToolsVersion": "33.0.0"
}
}
}
]
}
Use RFC020 targets in your build script:
// Build Android components
Target BuildAndroid => _ => _
.DependsOn(RFC020BuildAndroidCore)
.Executes(() =>
{
// Your custom Android build logic
});
// Full Android integration
Target AndroidComplete => _ => _
.DependsOn(RFC020AndroidBuildIntegration)
.Executes(() =>
{
Serilog.Log.Information("๐ Android build system ready!");
});
The Android build component implements the RFC018 Build Component Specification:
[BuildComponent("android")]
public class AndroidBuildComponent : IMobileBuildComponent
{
// RFC018 Lifecycle Implementation
public async Task<ComponentDiscoveryResult> DiscoverAsync(ComponentDiscoveryContext context)
public async Task<ComponentInitializationResult> InitializeAsync(ComponentInitializationContext context)
public async Task<ComponentConfigurationResult> ConfigureAsync(ComponentConfigurationContext context)
public async Task<ComponentValidationResult> ValidateAsync(ComponentValidationContext context)
// Mobile Build Implementation
public async Task<MobileBuildResult> BuildAsync(MobileBuildContext context)
public async Task<MobileTestResult> TestAsync(MobileTestContext context)
public async Task<MobileDeployResult> DeployAsync(MobileDeployContext context)
public async Task<MobileValidationResult> ValidateEnvironmentAsync(MobileValidationContext context)
}
AndroidBuildContext - Build configuration:
var buildContext = new AndroidBuildContext
{
BuildVariant = "release",
GradlePath = "gradlew",
GradleProjectPath = "./android",
BuildBundle = true, // Generate AAB instead of APK
TargetSdkVersion = 33,
MinSdkVersion = 21,
SigningConfig = new AndroidSigningConfig
{
KeystorePath = "path/to/keystore.jks",
KeystorePassword = Environment.GetEnvironmentVariable("KEYSTORE_PASSWORD"),
KeyAlias = Environment.GetEnvironmentVariable("KEY_ALIAS"),
KeyPassword = Environment.GetEnvironmentVariable("KEY_PASSWORD")
}
};
AndroidTestContext - Test configuration:
var testContext = new AndroidTestContext
{
RunUnitTests = true,
RunInstrumentationTests = true,
AndroidDevice = "emulator-5554",
ApiLevel = 33,
TestRunner = "androidx.test.runner.AndroidJUnitRunner"
};
AndroidDeployContext - Deployment configuration:
var deployContext = new AndroidDeployContext
{
UploadToPlayStore = true,
ServiceAccountKeyFile = "path/to/service-account.json",
PlayStoreTrack = "internal",
UploadToFirebase = true,
FirebaseConfig = new FirebaseDistributionConfig
{
AppId = "1:123456789:android:abc123",
ServiceAccountKeyFile = "path/to/firebase-service-account.json",
ReleaseNotes = "New release with exciting features!"
}
};
| Target | Description |
|---|---|
RFC020BuildAndroidCore |
Build Android components with environment validation |
RFC020ValidateAndroidEnvironment |
Validate Android SDK, JDK, and toolchain |
RFC020ConfigureAndroidSigning |
Setup signing configuration and keystore management |
RFC020EnableAndroidAdvancedFeatures |
Enable AAB support, version management, and artifacts |
| Target | Description |
|---|---|
RFC020RunAndroidTests |
Execute comprehensive Android test suite |
RFC020TestAndroidSigning |
Test APK/AAB signing and validation |
| Target | Description |
|---|---|
RFC020AndroidBuildIntegration |
Complete Android build integration (all phases) |
RFC020AndroidQuick |
Quick development cycle (core + validation only) |
RFC020ValidateAndroidCI |
Validate CI/CD pipeline integration |
The component performs comprehensive environment validation:
ANDROID_SDK_ROOT or ANDROID_HOMEJAVA_HOME with JDK 11, 17, or 21gradlew or gradlew.bat in project directorycd build/nuke
./build.ps1 RFC020ValidateAndroidEnvironment
Expected output:
๐ RFC020: Validating Android development environment...
๐ Android Environment Validation Results:
โ
AndroidSDK
โ
JavaJDK
โ
GradleWrapper
โ
FastlaneGem
๐ Android development environment fully configured
Automatically configured for development builds:
// app/build.gradle
android {
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
}
Environment-based release signing:
// app/build.gradle
android {
signingConfigs {
release {
storeFile file(System.getenv('ANDROID_KEYSTORE_PATH'))
storePassword System.getenv('ANDROID_KEYSTORE_PASSWORD')
keyAlias System.getenv('ANDROID_KEY_ALIAS')
keyPassword System.getenv('ANDROID_KEY_PASSWORD')
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
# Required for release builds
export ANDROID_KEYSTORE_PATH="/secure/path/to/release.keystore"
export ANDROID_KEYSTORE_PASSWORD="your-secure-keystore-password"
export ANDROID_KEY_ALIAS="your-release-key-alias"
export ANDROID_KEY_PASSWORD="your-secure-key-password"
Build Lanes:
fastlane android build - Build Android APK or AABfastlane android configure_signing - Setup signing configurationTesting Lanes:
fastlane android unit_test - Run unit testsfastlane android instrumentation_test - Run instrumentation testsDeployment Lanes:
fastlane android deploy_play_store - Deploy to Google Play Consolefastlane android deploy_firebase - Deploy to Firebase App DistributionValidation Lanes:
fastlane android validate_environment - Validate build environment# Build release AAB with signing
fastlane android build \
project_path:"./android" \
build_variant:"release" \
bundle_enabled:"true" \
keystore_path:"release.keystore" \
output_path:"build/outputs"
# Deploy to Play Store internal track
fastlane android deploy_play_store \
service_account_key:"service-account.json" \
artifact_path:"app-release.aab" \
track:"internal"
# Deploy to Firebase App Distribution
fastlane android deploy_firebase \
app_id:"1:123456789:android:abc123" \
service_account_key:"firebase-service-account.json" \
artifact_path:"app-debug.apk" \
testers:"test@example.com,test2@example.com" \
release_notes:"Beta release for testing"
Configure in build-config.json:
{
"android": {
"productFlavors": ["demo", "full", "enterprise"],
"buildTypes": ["debug", "release", "staging"],
"defaultBuildVariant": "demoDebug"
}
}
Resulting build variants:
demoDebug, demoRelease, demoStagingfullDebug, fullRelease, fullStagingenterpriseDebug, enterpriseRelease, enterpriseStagingEnable AAB builds for Google Play Console:
var buildContext = new AndroidBuildContext
{
BuildVariant = "release",
BuildBundle = true, // Generate .aab instead of .apk
// ... other configuration
};
Automatic version code and version name management:
# Via NUKE build parameters
./build.ps1 RFC020AndroidBuildIntegration \
--android-version-code 42 \
--android-version-name "2.1.0"
# Via Fastlane parameters
fastlane android build \
version_code:42 \
version_name:"2.1.0"
Configure obfuscation in build context:
var buildContext = new AndroidBuildContext
{
ObfuscationConfig = new AndroidObfuscationConfig
{
Enabled = true,
EnableMinification = true,
ShrinkResources = true,
OptimizationLevel = 2,
ConfigFiles = new List<string> { "proguard-rules.pro" }
}
};
The component includes a comprehensive GitHub Actions workflow:
# .github/workflows/rfc020-android-integration.yml
name: RFC020 Android Build Integration
on:
push:
branches: [ feature/rfc020-android-build-integration, main ]
jobs:
build-android-components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
- uses: android-actions/setup-android@v3
- name: Build Android
run: ./build.ps1 RFC020AndroidBuildIntegration
Configure in your CI/CD environment:
# GitHub Secrets
ANDROID_KEYSTORE_PASSWORD=your-keystore-password
ANDROID_KEY_ALIAS=your-key-alias
ANDROID_KEY_PASSWORD=your-key-password
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY=base64-encoded-service-account.json
FIREBASE_SERVICE_ACCOUNT_KEY=base64-encoded-firebase-service-account.json
Android SDK Not Found:
# Set the correct Android SDK path
export ANDROID_SDK_ROOT="/Users/username/Library/Android/sdk"
# or
export ANDROID_HOME="/Users/username/Library/Android/sdk"
Gradle Build Failed:
# Clean and rebuild
cd android
./gradlew clean
./gradlew assembleDebug --stacktrace
Signing Configuration Issues:
# Verify keystore file exists and passwords are correct
keytool -list -v -keystore path/to/keystore.jks
Fastlane Lane Failures:
# Run with verbose logging
fastlane android build --verbose
Enable detailed logging:
# NUKE build with debug logging
./build.ps1 RFC020AndroidBuildIntegration --verbosity diagnostic
# Fastlane with debug mode
export FASTLANE_VERBOSE=1
fastlane android build
The RFC020 implementation includes sample projects:
Sample projects are available in:
samples/android-builds/
โโโ unity-android-game/
โโโ gradle-android-app/
โโโ multi-variant-app/
Run Android component unit tests:
cd build/nuke
./build.ps1 RFC020RunAndroidTests
Test full Android build integration:
cd build/nuke
./build.ps1 RFC020AndroidBuildIntegration --test-mode
Validate environment and configuration:
cd build/nuke
./build.ps1 RFC020ValidateAndroidCI
org.gradle.parallel=true// app/build.gradle - Optimize resources
android {
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
}
}
}
dotnet restore./build.ps1 RFC020RunAndroidTestsFollow RFC018 patterns for component extensions:
[BuildComponent("android-custom")]
public class CustomAndroidComponent : AndroidBuildComponent
{
// Custom Android build logic
}
/docs/architecture/RFC020-ANDROID-BUILD-INTEGRATION.mdCopyright ยฉ 2025 GiantCroissant. All rights reserved.
RFC020: Android Build Integration - Complete Android build support with enterprise-grade automation, security, and deployment capabilities.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on GiantCroissant.Lunar.Build.Mobile.Android:
| Package | Downloads |
|---|---|
|
GiantCroissant.Lunar.Build
Meta-package that depends on the Lunar Build component packages for one-line install. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1-ci.113 | 181 | 10/7/2025 |
| 0.1.1-ci.112 | 174 | 10/7/2025 |
| 0.1.1-ci.111 | 268 | 9/15/2025 |
| 0.1.1-ci.110 | 243 | 9/15/2025 |
| 0.1.1-ci.109 | 251 | 9/15/2025 |
| 0.1.1-ci.108 | 254 | 9/15/2025 |
| 0.1.1-ci.107 | 252 | 9/15/2025 |
| 0.1.1-ci.104 | 223 | 9/15/2025 |
| 0.1.1-ci.90 | 178 | 9/8/2025 |
| 0.1.1-ci.40 | 114 | 9/6/2025 |
| 0.1.1-chore-ci-pack-mobile-... | 80 | 9/4/2025 |