Skip to content

Refactor and decouple Android Sdk tools from Android Apk #36

Description

@silbinarywolf

Description

const android_tools = android.Tools.create(b, .{
    .api_level = .android15,
    .build_tools_version = "35.0.1",
    .ndk_version = "29.0.13113456",
});
const apk = android.APK.create(b, android_tools);

I propose that we split out api_level and ndk_version into something like:

const android_sdk: android.Sdk = android.Sdk.create(b, .{}); // <- Second parameter will likely be an empty struct but we'll add options later if need be.
const apk = android_sdk.createApk(b, .{
    // .api_level = .android15, // <- Maybe even possibly deprecate and just use the `Target.Query.android_api_level`
    .build_tools_version = "35.0.1",
    .ndk_version = "29.0.13113456",
});

From there, it would be nice to add additional machinery like being able to invoke commands like sdkmanager via the newly created android.Sdk through Zig to avoid needing to think about setting up environment variables like $ANDROID_HOME and $JDK_PATH.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions