classifierWithLikes breaks protobuf-gradle-plugin

It causes it to try to download protoc with _fedora in its classifier.
This commit is contained in:
Eric Anderson 2015-09-17 15:38:12 -07:00
parent 9987aa28a3
commit 551323f93e
2 changed files with 40 additions and 12 deletions

View File

@ -52,12 +52,6 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
```xml ```xml
<project> <project>
<properties>
<!-- Configure the os-maven-plugin extension to expand the classifier on -->
<!-- Fedora-"like" systems. -->
<os.detection.classifierWithLikes>fedora</os.detection.classifierWithLikes>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
@ -76,6 +70,31 @@ In Maven, you can use the [os-maven-plugin](https://github.com/trustin/os-maven-
<version>1.4.0.Final</version> <version>1.4.0.Final</version>
</extension> </extension>
</extensions> </extensions>
<plugins>
<!-- Use Ant to configure the appropriate "tcnative.classifier" property -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<configuration>
<exportAntProperties>true</exportAntProperties>
<target>
<condition property="tcnative.classifier"
value="${os.detected.classifier}-fedora"
else="${os.detected.classifier}">
<isset property="os.detected.release.fedora"/>
</condition>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>
``` ```
@ -97,11 +116,15 @@ buildscript {
// Use the osdetector-gradle-plugin // Use the osdetector-gradle-plugin
apply plugin: "com.google.osdetector" apply plugin: "com.google.osdetector"
// Configure a special classifier on Fedora-"like" systems. def tcnative_classifier = osdetector.classifier;
osdetector.classifierWithLikes = ['fedora'] // Fedora variants use a different soname for OpenSSL than other linux distributions
// (see http://netty.io/wiki/forked-tomcat-native.html).
if (osdetector.os == "linux" && osdetector.release.isLike("fedora")) {
tcnative_classifier += "_fedora";
}
dependencies { dependencies {
compile 'io.netty:netty-tcnative:1.1.33.Fork7:' + osdetector.classifier compile 'io.netty:netty-tcnative:1.1.33.Fork7:' + tcnative_classifier
} }
``` ```

View File

@ -17,8 +17,6 @@ subprojects {
apply plugin: "jacoco" apply plugin: "jacoco"
apply plugin: "com.google.osdetector" apply plugin: "com.google.osdetector"
// Configure a special classifier on Fedora-"like" systems.
osdetector.classifierWithLikes = ['fedora']
group = "io.grpc" group = "io.grpc"
version = "0.10.0-SNAPSHOT" version = "0.10.0-SNAPSHOT"
@ -112,6 +110,13 @@ subprojects {
} }
} }
def tcnative_suffix = osdetector.classifier;
// Fedora variants use a different soname for OpenSSL than other linux distributions
// (see http://netty.io/wiki/forked-tomcat-native.html).
if (osdetector.os == "linux" && osdetector.release.isLike("fedora")) {
tcnative_suffix += "_fedora";
}
def epoll_suffix = ""; def epoll_suffix = "";
if (osdetector.classifier in ["linux-x86_64"]) { if (osdetector.classifier in ["linux-x86_64"]) {
// The native code is only pre-compiled on certain platforms. // The native code is only pre-compiled on certain platforms.
@ -131,7 +136,7 @@ subprojects {
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.7.0', protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.7.0',
netty: 'io.netty:netty-codec-http2:4.1.0.Beta6', netty: 'io.netty:netty-codec-http2:4.1.0.Beta6',
netty_tcnative: 'io.netty:netty-tcnative:1.1.33.Fork7:' + osdetector.classifier, netty_tcnative: 'io.netty:netty-tcnative:1.1.33.Fork7:' + tcnative_suffix,
netty_transport_native_epoll: 'io.netty:netty-transport-native-epoll:4.1.0.Beta6' + epoll_suffix, netty_transport_native_epoll: 'io.netty:netty-transport-native-epoll:4.1.0.Beta6' + epoll_suffix,
// Test dependencies. // Test dependencies.