Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven build #15

Merged
merged 9 commits into from Aug 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -14,3 +14,6 @@ riak_pb/*_pb2.py
build
*.pyc
dist/*.egg

# Java
target/*
30 changes: 25 additions & 5 deletions Makefile
Expand Up @@ -4,14 +4,14 @@ all: compile

deps: erl_deps

compile: erl_compile python_compile
compile: erl_compile python_compile java_compile

clean: erl_clean python_clean
clean: erl_clean python_clean java_clean

distclean: clean
rm -rf dist

release: python_release
release: python_release java_release

test: erl_test

Expand All @@ -30,13 +30,33 @@ erl_test: erl_compile

# Python specific build steps
python_compile:
@echo "==> Python"
@echo "==> Python (compile)"
@./setup.py build

python_clean:
@echo "==> Python"
@echo "==> Python (clean)"
@./setup.py clean

python_release: python_compile
@echo "==> Python (release)"
@python2.6 setup.py bdist_egg upload
@python2.7 setup.py bdist_egg upload

# Java specific build steps
java_compile:
@echo "==> Java (compile)"
@mvn install

java_clean:
@echo "==> Java (clean)"
@mvn clean

java_release:
@echo "==> Java"
ifeq ($(RELEASE_GPG_KEYNAME),)
@echo "RELEASE_GPG_KEYNAME must be set to release/deploy"
else
@mvn clean
@mvn deploy -Dgithub.downloads=true
endif

260 changes: 260 additions & 0 deletions pom.xml
@@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.basho.riak.protobuf</groupId>
<artifactId>riak-pb</artifactId>
<version>1.2</version>
<packaging>jar</packaging>

<name>Riak Protocol Buffers</name>
<description>Protocol buffers used to communicate with Riak</description>
<url>https://github.com/basho/riak_pb</url>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<developers>
<developer>
<name>Brian Roach</name>
<email>roach@basho.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:ssh://git@github.com/basho/riak_pb.git</connection>
<developerConnection>scm:git:ssh://git@github.com/basho/riak_pb.git</developerConnection>
<url>http://github.com/basho/riak_pb</url>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<pluginRepositories>
<pluginRepository>
<id>davidtrott</id>
<url>http://maven.davidtrott.com/repository</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.google.protobuf.tools</groupId>
<artifactId>maven-protoc-plugin</artifactId>
<version>0.1.10</version>
<configuration>
<protocExecutable>protoc</protocExecutable>
<protoSourceRoot>${project.basedir}/src</protoSourceRoot>
<languageSpecifications>
<LanguageSpecification>
<language>JAVA</language>
<outputDirectory>${project.basedir}/target/generated-sources/java</outputDirectory>
</LanguageSpecification>
</languageSpecifications>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>enforce-environment</id>
<phase>deploy</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>skip.deploy</property>
<regex>true</regex>
<message>*** You must set the RELEASE_GPG_KEYNAME environment variable to deploy! ***</message>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deploy</id>
<activation>
<property>
<name>env.RELEASE_GPG_KEYNAME</name>
</property>
</activation>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<configuration>
<useAgent>true</useAgent>
<keyname>${env.RELEASE_GPG_KEYNAME}</keyname>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>githubUpload</id>
<activation>
<property>
<name>github.downloads</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>downloads-maven-plugin</artifactId>
<version>0.4</version>
<configuration>
<description>${project.version} release of ${project.name}</description>
<override>false</override>
<includeAttached>true</includeAttached>
</configuration>
<executions>
<execution>
<goals>
<goal>upload</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>net.avh4.util</groupId>
<artifactId>imagecomparison</artifactId>
<version>0.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.4.1</version>
</dependency>
</dependencies>
</project>
5 changes: 5 additions & 0 deletions src/riak.proto
Expand Up @@ -25,6 +25,11 @@
** Revision: 1.2
*/

// Java package specifiers
option java_package = "com.basho.riak.protobuf";
option java_outer_classname = "RiakPB";


// Error response - may be generated for any Req
message RpbErrorResp {
required bytes errmsg = 1;
Expand Down
4 changes: 4 additions & 0 deletions src/riak_kv.proto
Expand Up @@ -25,6 +25,10 @@
** Revision: 1.2
*/

// Java package specifiers
option java_package = "com.basho.riak.protobuf";
option java_outer_classname = "RiakKvPB";

import "riak.proto"; // for RpbPair

// Get ClientId Request - no message defined, just send RpbGetClientIdReq message code
Expand Down
4 changes: 4 additions & 0 deletions src/riak_search.proto
Expand Up @@ -27,6 +27,10 @@

import "riak.proto";

// java package specifiers
option java_package = "com.basho.riak.protobuf";
option java_outer_classname = "RiakSearchPB";

message RpbSearchDoc {
repeated RpbPair fields = 1;
}
Expand Down