29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
package {
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
// Soong expands $(genDir) to __SBOX_SANDBOX_DIR__/out
|
|
// and $(out) to __SBOX_SANDBOX_DIR__/out/build/bazel/examples/gensrcs/data1.out
|
|
// In mixed build, Bp2build converts $(genDir) to $(GENDIR)
|
|
// which is expanded to ctx.var['GENDIR']
|
|
gensrcs {
|
|
name: "examples.gensrcs.make_data1",
|
|
srcs: ["data1.txt"],
|
|
output_extension: "out",
|
|
cmd: "mkdir -p $(genDir)/out_dir " +
|
|
"&& touch $(genDir)/out_dir/data.text " +
|
|
"&& cat $(genDir)/out_dir/data.text > $(out)",
|
|
}
|
|
|
|
// Verify
|
|
// * Regardless of whether the action is generated by Soong or Bazel,
|
|
// * $(genDir)/build/bazel/examples/gensrcs/data/data2.out is equivalent to $(out) both Soong and Bazel
|
|
// * The output path (i.e. data/data2.txt) is nestedly intact with input path (i.e. data/data2.out)
|
|
gensrcs {
|
|
name: "examples.gensrcs.make_data2",
|
|
srcs: ["data/data2.txt"],
|
|
output_extension: "out",
|
|
cmd: "cat $(in) > $(out) " +
|
|
"&& cat $(genDir)/build/bazel/examples/gensrcs/data/data2.out",
|
|
}
|