aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java
diff options
context:
space:
mode:
authorGravatar Erik Abair <abaire@google.com>2016-04-06 15:02:02 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-04-07 11:46:32 +0000
commit2e59ad744028349d8a0d188edf89e233ac3d9bbf (patch)
tree82417019edf1ec2c2a8d9a03463da1e7e90356cb /src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java
parente804017809ed3990bbb2f5e6b6cffdcf037349f6 (diff)
Expose ObjcConfiguration to Skylark as fragment "objc" along with callable methods to return compiler options useful for reflection in aspects.
RELNOTES[NEW]: Objective-C compiler information is now available to Skylark. -- MOS_MIGRATED_REVID=119160290
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java
index 36f73aa8ae..ec85472ae8 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcConfiguration.java
@@ -24,6 +24,8 @@ import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.rules.apple.DottedVersion;
import com.google.devtools.build.lib.rules.objc.ReleaseBundlingSupport.SplitArchTransition.ConfigurationDistinguisher;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
+import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.vfs.Path;
@@ -36,6 +38,7 @@ import javax.annotation.Nullable;
/**
* A compiler configuration containing flags required for Objective-C compilation.
*/
+@SkylarkModule(name = "objc", doc = "A configuration fragment for Objective-C")
@Immutable
public class ObjcConfiguration extends BuildConfiguration.Fragment {
@VisibleForTesting
@@ -141,6 +144,9 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment {
/**
* Returns the default set of clang options for the current compilation mode.
*/
+ @SkylarkCallable(name = "copts_for_current_compilation_mode", structField = true,
+ doc = "Returns a list of default options to use for compiling Objective-C in the current "
+ + "mode.")
public ImmutableList<String> getCoptsForCompilationMode() {
switch (compilationMode) {
case DBG:
@@ -165,6 +171,10 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment {
* Returns options passed to (Apple) clang when compiling Objective C. These options should be
* applied after any default options but before options specified in the attributes of the rule.
*/
+ @SkylarkCallable(name = "copts", structField = true,
+ doc = "Returns a list of options to use for compiling Objective-C."
+ + "These options are applied after any default options but before options specified in the "
+ + "attributes of the rule.")
public ImmutableList<String> getCopts() {
return copts;
}