Skip to content

rjodinchr/ninja-to-soong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ninja to Soong CI badge

ninja-to-soong is a project to generate Soong files (Android.bp) for the Android build system.

Legal

ninja-to-soong is licensed under the terms opf the Apache 2.0 license

How does it work?

  1. ninja-to-soong generates Ninja files using either:
  2. ninja-to-soong generates Soong files using Ninja files.

Supported projects

Project Ninja Generator Targets
clvk CMake libclvk.so
clspv CMake clvk dependencies
llvm-project CMake clvk & clspv dependencies
SPIRV-Tools CMake clvk dependencies
SPIRV-Headers CMake clspv & SPIRV-Tools dependencies
angle (WIP) GN libEGL_angle.so, libGLESv2_angle.so, libGLESv1_CM_angle.so
mesa (WIP) meson libEGL_mesa.so, libGLESv2_mesa.so, libGLESv1_CM_mesa.so, libintel_mesa.so, libgallium_dri.so, libglapi.so, pps-producer

Dependencies

ninja-to-soong depends on the following:

Using ninja-to-soong

<ninja-to-soong> $ cargo run --release -- --aosp-path <path> <project1> <project2>

Options

  • --aosp-path <path>: Path to Android tree (required for most project)
  • --clean-tmp: Remove the temporary directory before running
  • --copy-to-aosp: Copy generated Soong files into the Android tree
  • --skip-build: Skip build step
  • --skip-gen-ninja: Skip generation of Ninja files
  • -h, --help: Display the help and exit

Environment variables

  • N2S_ANGLE_PATH: Path to angle sources (default: <aosp-path>/external/angle)
  • N2S_MESA_PATH: Path to mesa sources (default: <aosp-path>/external/mesa)
  • N2S_NDK: Android NDK (default: android-ndk-r27c)
  • N2S_NDK_PATH: Path to Android NDK (default: temporary directory)
  • N2S_TMP_PATH: Path used by ninja-to-soong to store its temporary directories (default: std::env::temp_dir())

Tests

ninja-to-soong uses github actions to check that changes do not bring regression. It checks that the generated files match their reference (located in the tests folder).

Each project in the tests folder contains the following files:

  • Android.bp: the reference file to generate
  • checkout.sh: a script to checkout the repository in the CI
  • gen-ninja.sh: a script to generate Ninja files

Modification to checkout.sh & gen-ninja.sh trigger the generation of Ninja files in the CI, otherwise it uses the cached files from a previous CI run.

If you want more information take a look at the github action script

Releases

No releases published

Packages

No packages published