1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 apply plugin: 'java' 18 19 configurations { 20 micro 21 nano 22 } 23 24 sourceSets { 25 micro { 26 java { 27 srcDirs = ['java/src/main/java/'] 28 include("com/google/protobuf/micro/*") 29 } 30 } 31 32 nano { 33 java { 34 srcDirs = [ 35 'java/src/main/java/', 36 'java/src/device/main/java/' 37 ] 38 include("com/google/protobuf/nano/**") 39 } 40 } 41 } 42 43 if (project == rootProject) { 44 ext.getAndroidPrebuilt = { apiLevel -> 45 files("$rootDir/../../prebuilts/sdk/$apiLevel/android.jar") 46 } 47 } 48 49 dependencies { 50 compile getAndroidPrebuilt('8') 51 nanoCompile getAndroidPrebuilt('8') 52 } 53 54 jar { 55 from sourceSets.nano.output, sourceSets.micro.output 56 baseName "libprotobuf" 57 appendix "java" 58 version "2.3" 59 classifier "micronano" 60 } 61 62 task nanoJar(type: Jar) { 63 from sourceSets.nano.output 64 dependsOn nanoClasses 65 baseName "libprotobuf" 66 appendix "java" 67 version "2.3" 68 classifier "nano" 69 } 70 71 task microJar(type: Jar) { 72 from sourceSets.micro.output 73 dependsOn microClasses 74 baseName "libprotobuf" 75 appendix "java" 76 version "2.3" 77 classifier "micro" 78 } 79 80 artifacts { 81 micro microJar 82 nano nanoJar 83 } 84 85