Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 053fca10 authored by Colin Cross's avatar Colin Cross
Browse files

Support ninja rsp files in soong_zip

Add a -r argument to soong_zip that reads a list of files from a file
like the -l argument but treats it as a Ninja rsp file with escaping.
Replace the -l arguments in Soong that are using rsp files with -r.

Fixes: 162435077
Test: TestReadRespFile, TestZip
Change-Id: I4605312e99406ab1bd0c37af9c5ad212393f0403
parent 2d815963
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ func robolectricTestSuite(ctx SingletonContext, files map[string]InstallPaths) W
		FlagWithOutput("-o ", outputFile).
		FlagWithArg("-P ", "host/testcases").
		FlagWithArg("-C ", testCasesDir.String()).
		FlagWithRspFileInputList("-l ", installedPaths.Paths())
		FlagWithRspFileInputList("-r ", installedPaths.Paths())
	rule.Build(pctx, ctx, "robolectric_tests_zip", "robolectric-tests.zip")

	return outputFile
+4 −4
Original line number Diff line number Diff line
@@ -265,9 +265,9 @@ var (

	zip = pctx.AndroidStaticRule("zip",
		blueprint.RuleParams{
			Command:        "cat $out.rsp | tr ' ' '\\n' | tr -d \\' | sort -u > ${out}.tmp && ${SoongZipCmd} -o ${out} -C $$OUT_DIR -l ${out}.tmp",
			Command:        "${SoongZipCmd} -o ${out} -C $$OUT_DIR -r ${out}.rsp",
			CommandDeps:    []string{"${SoongZipCmd}"},
			Rspfile:        "$out.rsp",
			Rspfile:        "${out}.rsp",
			RspfileContent: "$in",
		})

+1 −1
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ func (s *fuzzPackager) GenerateBuildActions(ctx android.SingletonContext) {
			command := builder.Command().BuiltTool(ctx, "soong_zip").
				Flag("-j").
				FlagWithOutput("-o ", corpusZip)
			command.FlagWithRspFileInputList("-l ", fuzzModule.corpus)
			command.FlagWithRspFileInputList("-r ", fuzzModule.corpus)
			files = append(files, fileToZip{corpusZip, ""})
		}

+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ func lintZip(ctx android.BuilderContext, paths android.Paths, outputPath android
	rule.Command().BuiltTool(ctx, "soong_zip").
		FlagWithOutput("-o ", outputPath).
		FlagWithArg("-C ", android.PathForIntermediates(ctx).String()).
		FlagWithRspFileInputList("-l ", paths)
		FlagWithRspFileInputList("-r ", paths)

	rule.Build(pctx, ctx, outputPath.Base(), outputPath.Base())
}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ var (

	zipFiles = pctx.AndroidStaticRule("SnapshotZipFiles",
		blueprint.RuleParams{
			Command: `${config.SoongZipCmd} -C $basedir -l $out.rsp -o $out`,
			Command: `${config.SoongZipCmd} -C $basedir -r $out.rsp -o $out`,
			CommandDeps: []string{
				"${config.SoongZipCmd}",
			},
Loading