Skip to content

Commit

Permalink
Improve documentation, change repo name since now it supports more bu…
Browse files Browse the repository at this point in the history
…ild systems
  • Loading branch information
bensadiku committed Sep 22, 2021
1 parent 589b83d commit 923ab5e
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Cargo.toml
@@ -1,6 +1,12 @@
[package]
name = "genandroidmk_rs"
version = "1.2.0"
name = "genapkbuild"
version = "1.3.0"
readme = "README.md"
repository = "https://github.com/bensadiku/genapkbuild"
description = "A tool to generate Android APK build system files for AOSP"
documentation = "https://docs.rs/genapkbuild"
homepage = "https://github.com/bensadiku/genapkbuild"
keywords = ["aosp", "android", "apk", "rust"]
license = "MIT OR Apache-2.0"
authors = ["Behxhet Sadiku <bensadiku65@gmail.com>"]
edition = "2018"
Expand Down
24 changes: 17 additions & 7 deletions README.md
@@ -1,21 +1,24 @@
Generate Android Makefile
Generate AOSP build system files from APK
=====

A command-line tool to automatically generate `Android.mk` for Android apk-s.
⚠️ This library is a Work in Progress! ⚠️

A command-line tool to automatically generate `Android.mk` or `Android.bp` from Android APK-s.

The genandroidmk tool will analyze apk for architectures, find NDK-generated libraries inside and generate a makefile for it.
The genapkbuild tool will analyze APK for architectures, find NDK-generated libraries inside and generate makefile (`Android.mk`) or soong (`Android.bp`) for it. By default it will generate make files but it can be changed to generate soong files (Android.bp) by passing different flags.


This tool supports pre Kit-Kat style makefile generation too, by extracting NDK libraries from the APK and linking them into the makefile automatically. See [flags below for more information](#Flags).
This tool supports pre Kit-Kat style makefile generation too, by extracting .so libraries from the APK and linking them into the makefile automatically.

Ported from [go](https://github.com/northbright/genandroidmk) to rust with some more modifications, not backwards compatible with that tool.
See [flags below for more information](#Flags).

Inspired from northbright's tool written [Go](https://github.com/northbright/genandroidmk), ported to Rust and built on top of it, not backwards compatible with that tool (for the most part).

## Binaries

If you have Rust compiler installed, simply clone and run `cargo build --release`. A binary `genandroidmk_rs` will generated in `target/release/`.
If you have Rust compiler installed, simply clone and run `cargo build --release`. A binary `genapkbuild` will generated in `target/release/`.

If you don't have the compiler installed, you can download the binary from the [release tab](https://github.com/bensadiku/genandroidmk_rs/releases)
If you don't have the compiler installed, you can download the binary from the [release tab](https://github.com/bensadiku/genapkbuild/releases)


## Flags
Expand All @@ -27,6 +30,13 @@ If you don't have the compiler installed, you can download the binary from the [

This flag is required, it supplies the path of the APK we want to generate the makefile for.

### Soong (Android.bp) flag
---

`-s --soong`

This flag will create `Android.bp` instead of `Android.mk`

### Extract flag
---

Expand Down
2 changes: 1 addition & 1 deletion src/blueprint.rs
Expand Up @@ -33,7 +33,7 @@ impl BuildSystem for BluePrint {
//If we have some native libs, panic for now
if lib_size > 0 {
// FIXME: implement gen
panic!("BP generation for jni libs not supported yet see [https://github.com/bensadiku/genandroidmk_rs/issues/6]");
panic!("BP generation for jni libs not supported yet see [https://github.com/bensadiku/genapkbuild/issues/6]");
}

let bp = format!(
Expand Down
1 change: 0 additions & 1 deletion src/cli.rs
@@ -1,5 +1,4 @@
extern crate clap;
use super::file;
use crate::build::BuildSystemBase;
use clap::{App, Arg};

Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
@@ -1,3 +1,5 @@
#[allow(dead_code)]

mod build;
mod cli;
mod file;
Expand Down
2 changes: 1 addition & 1 deletion tests/architectures.rs
@@ -1,4 +1,4 @@
use genandroidmk_rs::build::BuildSystemBaseBuilder;
use genapkbuild::build::BuildSystemBaseBuilder;

mod helper;

Expand Down
2 changes: 1 addition & 1 deletion tests/helper.rs
@@ -1,4 +1,4 @@
use genandroidmk_rs::build::{BuildSystemBase, BuildSystemBaseBuilder};
use genapkbuild::build::{BuildSystemBase, BuildSystemBaseBuilder};
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion tests/input.rs
Expand Up @@ -5,7 +5,7 @@ use helper::get_random_mk;
#[cfg(test)]
mod tests {
use super::*;
use genandroidmk_rs::utils::input_to_abi_vec;
use genapkbuild::utils::input_to_abi_vec;

// run with `cargo test -- --nocapture` for the logs
// run with `cargo test -- --test-threads=1` for single threaded tests
Expand Down
2 changes: 1 addition & 1 deletion tests/naming.rs
@@ -1,7 +1,7 @@
mod helper;

use helper::{get_random_mk, mk_contains};
use genandroidmk_rs::build::BuildSystemBaseBuilder;
use genapkbuild::build::BuildSystemBaseBuilder;

#[test]
fn default_name() {
Expand Down
2 changes: 1 addition & 1 deletion tests/native_libs.rs
@@ -1,5 +1,5 @@
mod helper;
use genandroidmk_rs::build::BuildSystemBaseBuilder;
use genapkbuild::build::BuildSystemBaseBuilder;
use helper::{cleanup_path, file_exists, get_by_name, mk_contains};

#[test]
Expand Down

0 comments on commit 923ab5e

Please sign in to comment.