From 77c4f30b333106ff15de5b5dd42076db01fd22b4 Mon Sep 17 00:00:00 2001 From: cparsons Date: Wed, 28 Feb 2018 11:25:10 -0800 Subject: Remove unused fields from a few Cc* rule implementations. RELNOTES: None. PiperOrigin-RevId: 187356329 --- .../lib/bazel/rules/cpp/BazelCcSharedLibrary.java | 26 ----------- .../bazel/rules/cpp/BazelCcSharedLibraryRule.java | 49 --------------------- .../lib/bazel/rules/cpp/BazelCcStaticLibrary.java | 26 ----------- .../bazel/rules/cpp/BazelCcStaticLibraryRule.java | 50 ---------------------- .../build/lib/rules/cpp/CcSharedLibrary.java | 37 ---------------- .../build/lib/rules/cpp/CcStaticLibrary.java | 37 ---------------- 6 files changed, 225 deletions(-) delete mode 100644 src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibrary.java delete mode 100644 src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibraryRule.java delete mode 100644 src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibrary.java delete mode 100644 src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibraryRule.java delete mode 100644 src/main/java/com/google/devtools/build/lib/rules/cpp/CcSharedLibrary.java delete mode 100644 src/main/java/com/google/devtools/build/lib/rules/cpp/CcStaticLibrary.java (limited to 'src/main/java/com') diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibrary.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibrary.java deleted file mode 100644 index 05a65ea18c..0000000000 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibrary.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 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.bazel.rules.cpp; - -import com.google.devtools.build.lib.rules.cpp.CcSharedLibrary; - -/** - * {@code cc_shared_library} rule with Bazel semantics. - */ -public class BazelCcSharedLibrary extends CcSharedLibrary { - public BazelCcSharedLibrary() { - super(BazelCppSemantics.INSTANCE); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibraryRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibraryRule.java deleted file mode 100644 index 8143a6caa3..0000000000 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcSharedLibraryRule.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017 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.bazel.rules.cpp; - -import static com.google.devtools.build.lib.bazel.rules.cpp.BazelCppRuleClasses.DEPS_ALLOWED_RULES; -import static com.google.devtools.build.lib.packages.Attribute.attr; -import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST; -import static com.google.devtools.build.lib.syntax.Type.STRING_LIST; - -import com.google.devtools.build.lib.analysis.BaseRuleClasses; -import com.google.devtools.build.lib.analysis.RuleDefinition; -import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment; -import com.google.devtools.build.lib.bazel.rules.cpp.BazelCppRuleClasses.CcBaseRule; -import com.google.devtools.build.lib.packages.RuleClass; -import com.google.devtools.build.lib.packages.RuleClass.Builder; - -/** Rule definition for the cc_shared_library rule. */ -public final class BazelCcSharedLibraryRule implements RuleDefinition { - @Override - public RuleClass build(Builder builder, RuleDefinitionEnvironment env) { - return builder - .add(attr("reexport_deps", LABEL_LIST) - .allowedRuleClasses(DEPS_ALLOWED_RULES) - .allowedFileTypes()) - .add(attr("linkopts", STRING_LIST)) - .build(); - } - - @Override - public Metadata getMetadata() { - return RuleDefinition.Metadata.builder() - .name("cc_shared_library") - .ancestors(CcBaseRule.class, BaseRuleClasses.MakeVariableExpandingRule.class) - .factoryClass(BazelCcSharedLibrary.class) - .build(); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibrary.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibrary.java deleted file mode 100644 index d7a9c2fc6e..0000000000 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibrary.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2017 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.bazel.rules.cpp; - -import com.google.devtools.build.lib.rules.cpp.CcStaticLibrary; - -/** - * {@code cc_static_library} rule with Bazel semantics. - */ -public class BazelCcStaticLibrary extends CcStaticLibrary { - public BazelCcStaticLibrary() { - super(BazelCppSemantics.INSTANCE); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibraryRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibraryRule.java deleted file mode 100644 index a05f4423df..0000000000 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCcStaticLibraryRule.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017 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.bazel.rules.cpp; - -import static com.google.devtools.build.lib.bazel.rules.cpp.BazelCppRuleClasses.DEPS_ALLOWED_RULES; -import static com.google.devtools.build.lib.packages.Attribute.attr; -import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST; -import static com.google.devtools.build.lib.syntax.Type.STRING_LIST; - -import com.google.devtools.build.lib.analysis.BaseRuleClasses; -import com.google.devtools.build.lib.analysis.RuleDefinition; -import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment; -import com.google.devtools.build.lib.bazel.rules.cpp.BazelCppRuleClasses.CcBaseRule; -import com.google.devtools.build.lib.packages.RuleClass; -import com.google.devtools.build.lib.packages.RuleClass.Builder; - -/** Rule definition for the cc_static_library rule. */ -public final class BazelCcStaticLibraryRule implements RuleDefinition { - @Override - public RuleClass build(Builder builder, RuleDefinitionEnvironment env) { - return builder - .add( - attr("reexport_deps", LABEL_LIST) - .allowedRuleClasses(DEPS_ALLOWED_RULES) - .allowedFileTypes()) - .add(attr("linkopts", STRING_LIST)) - .build(); - } - - @Override - public Metadata getMetadata() { - return RuleDefinition.Metadata.builder() - .name("cc_shared_library") - .ancestors(CcBaseRule.class, BaseRuleClasses.MakeVariableExpandingRule.class) - .factoryClass(BazelCcStaticLibrary.class) - .build(); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSharedLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSharedLibrary.java deleted file mode 100644 index 289c4fdb4f..0000000000 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSharedLibrary.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 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.rules.cpp; - -import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; -import com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory; -import com.google.devtools.build.lib.analysis.RuleContext; - -/** - * A ConfiguredTarget for cc_shared_library rules. - */ -public abstract class CcSharedLibrary implements RuleConfiguredTargetFactory { - private final CppSemantics semantics; - - protected CcSharedLibrary(CppSemantics semantics) { - this.semantics = semantics; - } - - @Override - public ConfiguredTarget create(RuleContext context) - throws RuleErrorException, InterruptedException { - return new RuleConfiguredTargetBuilder(context).build(); - } -} \ No newline at end of file diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStaticLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStaticLibrary.java deleted file mode 100644 index d7c2006a0d..0000000000 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcStaticLibrary.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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.rules.cpp; - -import com.google.devtools.build.lib.analysis.ConfiguredTarget; -import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder; -import com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory; -import com.google.devtools.build.lib.analysis.RuleContext; - -/** - * A ConfiguredTarget for cc_static_library rules. - */ -public abstract class CcStaticLibrary implements RuleConfiguredTargetFactory { - private final CppSemantics semantics; - - protected CcStaticLibrary(CppSemantics semantics) { - this.semantics = semantics; - } - - @Override - public ConfiguredTarget create(RuleContext context) - throws RuleErrorException, InterruptedException { - return new RuleConfiguredTargetBuilder(context).build(); - } -} \ No newline at end of file -- cgit v1.2.3