Remove BuckUtils

Change-Id: Iba9535a60d1d48fbda9f6b560c11f204a232b10c
This commit is contained in:
David Pursehouse
2017-01-24 13:35:26 +09:00
parent 7e43d1d1ad
commit 7a9b0a95cd
2 changed files with 1 additions and 82 deletions

View File

@@ -1,79 +0,0 @@
// Copyright (C) 2015 The Android Open Source Project
//
// 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.gerrit.httpd.raw;
import static com.google.common.base.MoreObjects.firstNonNull;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Properties;
class BuckUtils extends BuildSystem {
BuckUtils(Path sourceRoot) {
super(sourceRoot);
}
@Override
protected ProcessBuilder newBuildProcess(Label label) throws IOException {
Properties properties = loadBuildProperties(
sourceRoot.resolve("buck-out/gen/tools/buck/buck.properties"));
String buck = firstNonNull(properties.getProperty("buck"), "buck");
ProcessBuilder proc = new ProcessBuilder(buck, "build", label.fullName());
if (properties.containsKey("PATH")) {
proc.environment().put("PATH", properties.getProperty("PATH"));
}
return proc;
}
@Override
public Path targetPath(Label label) {
return sourceRoot.resolve("buck-out")
.resolve("gen").resolve(label.artifact);
}
@Override
public String buildCommand(Label l) {
return "buck build " + l.toString();
}
@Override
public Label gwtZipLabel(String agent) {
// TODO(davido): instead of assuming specific Buck's internal
// target directory for gwt_binary() artifacts, ask Buck for
// the location of user agent permutation GWT zip, e. g.:
// $ buck targets --show_output //gerrit-gwtui:ui_safari \
// | awk '{print $2}'
String t = "ui_" + agent;
return new BuildSystem.Label("gerrit-gwtui", t,
String.format("gerrit-gwtui/__gwt_binary_%s__/%s.zip", t, t));
}
@Override
public Label polygerritComponents() {
return new Label("polygerrit-ui", "polygerrit_components",
"polygerrit-ui/polygerrit_components/" +
"polygerrit_components.bower_components.zip");
}
@Override
public Label fontZipLabel() {
return new Label("polygerrit-ui", "fonts", "polygerrit-ui/fonts/fonts.zip");
}
@Override
public String name() {
return "buck";
}
}

View File

@@ -363,9 +363,7 @@ public class StaticModule extends ServletModule {
}
sourceRoot = getSourseRootOrNull();
builder = GerritLauncher.isBazel()
? new BazelBuild(sourceRoot)
: new BuckUtils(sourceRoot);
builder = new BazelBuild(sourceRoot);
}
private static Path getSourseRootOrNull() {