Watch
0
0
Fork
You've already forked hyperhive
0

vm-tests: build a sample android app offline in the android-dev archetype

This commit is contained in:
damocles 2026-11-22 11:58:59 +01:00 • committed by mara
commit 36a8b4fa1f
7 changed files with 235 additions and 10 deletions

View file

@ -0,0 +1,17 @@
plugins {
id 'com.android.application' version '8.13.0'
}
android {
namespace = 'test.hyperhive.sample'
compileSdk = 35
buildToolsVersion = '36.1.0'
defaultConfig {
applicationId = 'test.hyperhive.sample'
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = '1.0'
}
}

View file

@ -0,0 +1,11 @@
// Build with the fetched dependencies as the only repository, so a build that
// needs anything else fails instead of reaching for the network.
beforeSettings { settings ->
def repo = System.getenv('ANDROID_DEPS_REPO')
settings.pluginManagement.repositories {
maven { url = uri(repo) }
}
settings.dependencyResolutionManagement.repositories {
maven { url = uri(repo) }
}
}

View file

@ -0,0 +1,12 @@
// Build with the real repositories: the fixed-output fetch of the dependencies.
beforeSettings { settings ->
settings.pluginManagement.repositories {
google()
mavenCentral()
gradlePluginPortal()
}
settings.dependencyResolutionManagement.repositories {
google()
mavenCentral()
}
}

View file

@ -0,0 +1,3 @@
// No repositories here: the init scripts in this directory add them, the
// real ones to fetch the dependencies and a file repository to build offline.
rootProject.name = 'sample'

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name">
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -0,0 +1,15 @@
package test.hyperhive.sample;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView view = new TextView(this);
view.setText(R.string.app_name);
setContentView(view);
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">hyperhive sample</string>
</resources>