Colin Cross | 63b75bc | 2017-12-08 19:10:37 -0800 | [diff] [blame] | 1 | // Copyright (C) 2010 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | genrule { |
| 16 | name: "smali_version", |
| 17 | srcs: [":smali_build.gradle"], |
| 18 | out: ["smali.properties"], |
| 19 | cmd: "echo \"application.version=$$(grep -o -e \"^version = '\\(.*\\)'\" $(in) | grep -o -e \"[0-9.]\\+\")-aosp\" > $(out)", |
| 20 | } |
| 21 | |
| 22 | // build smali jar |
| 23 | // ============================================================ |
| 24 | |
| 25 | java_binary_host { |
| 26 | name: "smali", |
| 27 | |
| 28 | srcs: [ |
| 29 | "src/main/java/**/*.java", |
| 30 | ], |
| 31 | |
| 32 | manifest: "manifest.txt", |
| 33 | |
| 34 | static_libs: [ |
| 35 | "antlr-runtime", |
| 36 | "dexlib2", |
| 37 | "jcommander", |
| 38 | "smali-util", |
| 39 | ], |
| 40 | |
| 41 | java_resources: [":smali_version"], |
| 42 | |
| 43 | wrapper: ":smali_script", |
| 44 | } |