blob: 46845929a766ecfea6a8b078313d54ef57741070 [file] [log] [blame]
Adam Metcalf57faa142013-08-08 10:16:58 -07001/*
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
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070017apply plugin: 'java'
18
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070019configurations {
20 micro
21 nano
22}
23
24sourceSets {
25 micro {
26 java {
Jeff Davidson721ea492014-04-22 23:25:53 -070027 srcDirs = ['java/src/main/java/']
28 include("com/google/protobuf/micro/*")
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070029 }
30 }
31
32 nano {
33 java {
Jeff Davidson721ea492014-04-22 23:25:53 -070034 srcDirs = [
35 'java/src/main/java/',
36 'java/src/device/main/java/'
37 ]
38 include("com/google/protobuf/nano/**")
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070039 }
40 }
41}
42
Jeff Davidson721ea492014-04-22 23:25:53 -070043if (project == rootProject) {
44 ext.getAndroidPrebuilt = { apiLevel ->
45 files("$rootDir/../../prebuilts/sdk/$apiLevel/android.jar")
46 }
47}
48
49dependencies {
50 compile getAndroidPrebuilt('8')
51 nanoCompile getAndroidPrebuilt('8')
52}
53
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070054jar {
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070055 from sourceSets.nano.output, sourceSets.micro.output
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070056 baseName "libprotobuf"
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070057 appendix "java"
Jeff Davidsona3b2a6d2014-09-15 16:29:06 -070058 version "2.6"
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070059 classifier "micronano"
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070060}
61
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070062task nanoJar(type: Jar) {
63 from sourceSets.nano.output
64 dependsOn nanoClasses
65 baseName "libprotobuf"
66 appendix "java"
Jeff Davidsona3b2a6d2014-09-15 16:29:06 -070067 version "2.6"
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070068 classifier "nano"
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070069}
70
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070071task microJar(type: Jar) {
72 from sourceSets.micro.output
73 dependsOn microClasses
74 baseName "libprotobuf"
75 appendix "java"
Jeff Davidsona3b2a6d2014-09-15 16:29:06 -070076 version "2.6"
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070077 classifier "micro"
Adam Metcalf98bbe8a2013-06-14 14:47:30 -070078}
79
Adam Metcalf9db9e1e2013-07-15 16:58:23 -070080artifacts {
81 micro microJar
82 nano nanoJar
Adam Metcalf57faa142013-08-08 10:16:58 -070083}
84