// Copyright 2020 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.packages.util;

import java.io.IOException;

/**
 * Creates mock BUILD files required for the genrule rule.
 */
public final class MockGenruleSupport {
  /**
   * Sets up mocking support for genrules.
   */
  public static void setup(MockToolsConfig config) throws IOException {
    config.create(
        "tools/genrule/BUILD",
        "exports_files(['genrule-setup.sh'])");
    config.create("tools/genrule/genrule-setup.sh");
  }
}

@@ -9,17 +9,17 @@
 ight 202
-0
+1
  The Baz
@@ -694,19 +694,16 @@
 on;%0A%0A/**
-%0A *
  Creates
@@ -750,17 +750,16 @@
 le rule.
-%0A
  */%0Apubl
@@ -799,21 +799,16 @@
  %7B%0A  /**
-%0A   *
  Sets up
@@ -837,19 +837,16 @@
 enrules.
-%0A  
  */%0A  pu
@@ -931,26 +931,32 @@
 .create(
-%0A        %22
+%22embedded_tools/
 tools/ge
@@ -972,16 +972,8 @@
 LD%22,
-%0A       
  %22ex
@@ -1028,16 +1028,31 @@
 create(%22
+embedded_tools/
 tools/ge

Make MockGenruleSupport work in bazel.