diff options
author | 2016-07-22 16:33:17 +0000 | |
---|---|---|
committer | 2016-07-22 20:11:12 +0000 | |
commit | b6a650936b83b12c9efb9014faa403b94a3b5625 (patch) | |
tree | 0ad460ce12ffc2650d436ac9651e8ac26eb43e4c /src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java | |
parent | 238bf4e778a39df24ebebf8be79e205d7a65e1e4 (diff) |
Add a resource merger state -> R class writer.
Collects the R class fields from the new merger's
internal state, and then writes out either an
R.java or R.class. TBD which to use. One concern
is that users may want the javadoc. If so,
perhaps this could generate the R.class, and
then aapt could generate the srcjar off of the
build critical path.
Refactor the RClassGenerator to make it easier to
use from merger state (vs from R.txt).
--
MOS_MIGRATED_REVID=128181306
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java b/src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java new file mode 100644 index 0000000000..522dca5974 --- /dev/null +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidFrameworkAttrIdProvider.java @@ -0,0 +1,36 @@ +// Copyright 2016 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.android; + +/** + * Provides the android.R.attr field IDs. + */ +public interface AndroidFrameworkAttrIdProvider { + + int getAttrId(String attrName) throws AttrLookupException; + + /** + * Exception thrown when lookup fails. + */ + final class AttrLookupException extends Exception { + + AttrLookupException(Throwable t) { + super(t); + } + + AttrLookupException(String s) { + super(s); + } + } +} |