]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /* |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | */ | |
19 | ||
20 | // Following Gradle best practices to keep build logic organized | |
21 | ||
22 | // ---------------------------------------------------------------------------- | |
23 | // source sets for main and test sources | |
24 | sourceSets { | |
25 | main { | |
26 | java { | |
27 | srcDir 'src' | |
28 | } | |
29 | } | |
30 | test { | |
31 | java { | |
32 | srcDir 'test' | |
33 | // see functionalTests.gradle for these files | |
34 | exclude '**/test/TestClient.java' | |
35 | exclude '**/test/TestServer.java' | |
36 | exclude '**/test/TestNonblockingServer.java' | |
37 | } | |
38 | resources { | |
39 | srcDir 'test' | |
40 | include 'log4j.properties' | |
41 | } | |
42 | } | |
43 | } | |
44 | ||
45 | // ---------------------------------------------------------------------------- | |
46 | // Compiler configuration details | |
47 | ||
48 | sourceCompatibility = '1.8' | |
49 | targetCompatibility = '1.8' | |
50 | ||
51 | tasks.withType(JavaCompile) { | |
52 | options.encoding = 'UTF-8' | |
53 | options.debug = true | |
54 | options.deprecation = true | |
55 | // options.compilerArgs.addAll('-Xlint:unchecked') | |
56 | } | |
57 | ||
58 | // ---------------------------------------------------------------------------- | |
59 | // Jar packaging details | |
60 | processResources { | |
61 | into('META-INF') { | |
62 | from "$thriftRoot/LICENSE" | |
63 | from "$thriftRoot/NOTICE" | |
64 | rename('(.+)', '$1.txt') | |
65 | } | |
66 | } | |
67 | ||
68 | jar { | |
69 | project.test.dependsOn it | |
70 | manifest { | |
71 | attributes([ | |
72 | "Implementation-Version": "${project.version}", | |
73 | "Bundle-ManifestVersion": "2", | |
74 | "Bundle-SymbolicName": "${project.group}", | |
75 | "Bundle-Name": "Apache Thrift", | |
76 | "Bundle-Version": "${project.version}", | |
77 | "Bundle-Description": "Apache Thrift library", | |
78 | "Bundle-License": "${project.license}", | |
79 | "Bundle-ActivationPolicy": "lazy", | |
80 | "Export-Package": "${project.group}.async;uses:=\"${project.group}.protocol,${project.group}.transport,org.slf4j,${project.group}\";version=\"${version}\",${project.group}.protocol;uses:=\"${project.group}.transport,${project.group},${project.group}.scheme\";version=\"${version}\",${project.group}.server;uses:=\"${project.group}.transport,${project.group}.protocol,${project.group},org.slf4j,javax.servlet,javax.servlet.http\";version=\"${version}\",${project.group}.transport;uses:=\"${project.group}.protocol,${project.group},org.apache.http.client,org.apache.http.params,org.apache.http.entity,org.apache.http.client.methods,org.apache.http,org.slf4j,javax.net.ssl,javax.net,javax.security.sasl,javax.security.auth.callback\";version=\"${version}\",${project.group};uses:=\"${project.group}.protocol,${project.group}.async,${project.group}.server,${project.group}.transport,org.slf4j,org.apache.log4j,${project.group}.scheme\";version=\"${version}\",${project.group}.meta_data;uses:=\"${project.group}\";version=\"${version}\",${project.group}.scheme;uses:=\"${project.group}.protocol,${project.group}\";version=\"${version}\"", | |
81 | "Import-Package": "javax.net,javax.net.ssl,javax.security.auth.callback,javax.security.sasl,javax.servlet;resolution:=optional,javax.servlet.http;resolution:=optional,org.slf4j;resolution:=optional;version=\"[1.4,2)\",org.apache.http.client;resolution:=optional,org.apache.http.params;resolution:=optional,org.apache.http.entity;resolution:=optional,org.apache.http.client.methods;resolution:=optional,org.apache.http;resolution:=optional" | |
82 | ]) | |
83 | } | |
84 | } |