Search in sources :

Example 1 with SequenceBuilder

use of com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.SequenceBuilder in project bazel by bazelbuild.

the class CcToolchainFeaturesTest method createNestedSequence.

private VariableValueBuilder createNestedSequence(int depth, int count, String prefix) {
    if (depth == 0) {
        StringSequenceBuilder builder = new StringSequenceBuilder();
        for (int i = 0; i < count; ++i) {
            String value = prefix + i;
            builder.addValue(value);
        }
        return builder;
    } else {
        SequenceBuilder builder = new SequenceBuilder();
        for (int i = 0; i < count; ++i) {
            String value = prefix + i;
            builder.addValue(createNestedSequence(depth - 1, count, value));
        }
        return builder;
    }
}
Also used : StringSequenceBuilder(com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.StringSequenceBuilder) SequenceBuilder(com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.SequenceBuilder) StringSequenceBuilder(com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.StringSequenceBuilder)

Aggregations

SequenceBuilder (com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.SequenceBuilder)1 StringSequenceBuilder (com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures.Variables.StringSequenceBuilder)1