Skip to content

Commit 9d3df50

Browse files
alexanderkjallcodingllama
authored andcommitted
Use maven to build java code (google#1375)
* moved java code to use maven as a build system * having the .idea dir in git is a bad idea * got the test cases working * make the jar file executable, and fixed some feedback from @codingllama * changes based on feedback in code review * reduced line length, and moving static imports before non-static * run maven in the travis build system
1 parent 3de78ad commit 9d3df50

File tree

76 files changed

+368
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+368
-709
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@
121121
/test/testdata/urlfetcher_test_certs/
122122

123123
# IntelliJ artefacts
124+
/java/.idea
124125
/java/.idea/dictionaries/
125126
/java/.idea/workspace.xml
126127
/java/out
128+
/java/target
129+
/java/ctlog.iml
130+
131+
# maven litter
132+
/java/src/test/resources/testdata
127133

128134
# Eclipse artefacts
129135
/java/.classpath

.travis.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ language: cpp
55
go:
66
- 1.7.1
77

8+
jdk:
9+
- oraclejdk8
10+
811
env:
912
global:
1013
- INSTALL_DIR=${TRAVIS_BUILD_DIR}/../install
@@ -25,6 +28,7 @@ addons:
2528
- libstdc++-4.9-dev
2629
- tcl8.5
2730
- cmake
31+
- maven
2832

2933
matrix:
3034
include:
@@ -76,7 +80,6 @@ cache:
7680
- $TRAVIS_BUILD_DIR/../depot_tools
7781
- $TRAVIS_BUILD_DIR/../install
7882

79-
8083
before_install:
8184
- eval "$(gimme 1.7)"
8285
# Set compiler version overrides if we have any:
@@ -91,8 +94,10 @@ before_install:
9194
- echo "INSTALL_DIR=${INSTALL_DIR}"
9295
- mkdir -p $GOPATH/src/github.com/google
9396
- ln -sf $PWD $GOPATH/src/github.com/google
94-
- echo "jars.protobuf = ${INSTALL_DIR}/java/protobuf.jar" > local.properties
95-
- echo "protoc.bin = ${PROTOC}" >> local.properties
97+
- if [ -e "/usr/lib/jvm/java-8-oracle/" ]; then export PATH="/usr/lib/jvm/java-8-oracle/bin:$PATH"; export JAVA_HOME=/usr/lib/jvm/java-8-oracle/; fi
98+
- echo "JAVA_HOME=$JAVA_HOME"
99+
- java -version
100+
- mvn -version
96101

97102
install:
98103
# Workaround LLVM's apt mirror being feeble and underpowered
@@ -105,7 +110,6 @@ install:
105110
- autoconf --version
106111
- pushd ..
107112
- mkdir -p ct
108-
- wget http://central.maven.org/maven2/com/google/protobuf/protobuf-java/2.6.0/protobuf-java-2.6.0.jar -O ${INSTALL_DIR}/java/protobuf.jar
109113
- if [ ! -e depot_tools/gclient ]; then git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi
110114
- export PATH="$PATH:/usr/local/bin:"`pwd`/depot_tools
111115
- cd ct
@@ -125,7 +129,7 @@ install:
125129
script:
126130
- getconf _NPROCESSORS_ONLN
127131
- ${MAKE} -j$(getconf _NPROCESSORS_ONLN) check VERBOSE=1 V=${ENV_VERBOSE}
128-
- ant build test
132+
- mvn -f java/pom.xml clean test
129133
- ${MAKE} -C python test
130134
- pushd ${GOPATH}
131135
- |

build.properties

Lines changed: 0 additions & 20 deletions
This file was deleted.

build.xml

Lines changed: 0 additions & 255 deletions
This file was deleted.

java/.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

java/.idea/codeStyleSettings.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

java/.idea/compiler.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.

java/.idea/copyright/profiles_settings.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)