From 8ceb98752d595128dbc6901e0c56765607824022 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 26 Feb 2014 20:33:27 +0100 Subject: [PATCH] Move master to Java 1.7 Closes #5267 --- dev-tools/build_randomization.rb | 12 +++++++----- dev-tools/build_release.py | 16 ++++++++-------- pom.xml | 26 ++++++++++++-------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dev-tools/build_randomization.rb b/dev-tools/build_randomization.rb index 2a5c313538e..b5be2bf86cb 100644 --- a/dev-tools/build_randomization.rb +++ b/dev-tools/build_randomization.rb @@ -40,8 +40,9 @@ class JDKSelector # do ranomize selection from a given array def select_one(selection_array = nil) - selection_array ||= @jdk_list + selection_array = filter_java_6(selection_array || @jdk_list) selection_array[rand(selection_array.size)] + get_random_one(selection_array) end end @@ -50,15 +51,16 @@ def get_random_one(data_array) data_array[rand(data_array.size)] end +def filter_java_6(files) + files.select{ |i| File.basename(i).split(/[^0-9]/)[-1].to_i > 6 } +end + # given a jdk directory selection, generate relevant environment variables def get_env_matrix(data_array) #refactoring target es_test_jvm_option1 = get_random_one(['-server']) #only server for now get_random_one(['-client', '-server']) - greater_than_six = File.basename([*data_array].first).split(/[^0-9]/)[-1].to_i > 6 - es_test_jvm_option2 = greater_than_six ? get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC', - '-XX:+UseG1GC']) : - get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC']) + es_test_jvm_option2 = get_random_one(['-XX:+UseConcMarkSweepGC', '-XX:+UseParallelGC', '-XX:+UseSerialGC', '-XX:+UseG1GC']) es_test_jvm_option3 = get_random_one(['-XX:+UseCompressedOops', '-XX:-UseCompressedOops']) es_node_mode = get_random_one(['local', 'network']) diff --git a/dev-tools/build_release.py b/dev-tools/build_release.py index 61fa53ebfaa..2ada63f8572 100644 --- a/dev-tools/build_release.py +++ b/dev-tools/build_release.py @@ -40,7 +40,7 @@ from http.client import HTTPConnection '--publish' option is set the actual release is done. The script takes over almost all steps necessary for a release from a high level point of view it does the following things: - - run prerequisit checks ie. check for Java 1.6 being presend or S3 credentials available as env variables + - run prerequisit checks ie. check for Java 1.7 being presend or S3 credentials available as env variables - detect the version to release from the specified branch (--branch) or the current branch - creates a release branch & updates pom.xml and Version.java to point to a release version rather than a snapshot - builds the artifacts and runs smoke-tests on the build zip & tar.gz files @@ -87,12 +87,12 @@ try: except KeyError: raise RuntimeError(""" Please set JAVA_HOME in the env before running release tool - On OSX use: export JAVA_HOME=`/usr/libexec/java_home -v '1.6*'`""") + On OSX use: export JAVA_HOME=`/usr/libexec/java_home -v '1.7*'`""") try: - JAVA_HOME = env['JAVA6_HOME'] + JAVA_HOME = env['JAVA7_HOME'] except KeyError: - pass #no JAVA6_HOME - we rely on JAVA_HOME + pass #no JAVA7_HOME - we rely on JAVA_HOME try: @@ -114,8 +114,8 @@ def verify_java_version(version): if s.find(' version "%s.' % version) == -1: raise RuntimeError('got wrong version for java %s:\n%s' % (version, s)) -# Verifies the java version. We guarantee that we run with Java 1.6 -# If 1.6 is not available fail the build! +# Verifies the java version. We guarantee that we run with Java 1.7 +# If 1.7 is not available fail the build! def verify_mvn_java_version(version, mvn): s = os.popen('%s; %s --version 2>&1' % (java_exe(), mvn)).read() if s.find('Java version: %s' % version) == -1: @@ -133,8 +133,8 @@ def get_tag_hash(tag): def get_current_branch(): return os.popen('git rev-parse --abbrev-ref HEAD 2>&1').read().strip() -verify_java_version('1.6') # we require to build with 1.6 -verify_mvn_java_version('1.6', MVN) +verify_java_version('1.7') # we require to build with 1.7 +verify_mvn_java_version('1.7', MVN) # Utility that returns the name of the release branch for a given version def release_branch(version): diff --git a/pom.xml b/pom.xml index cec724572e8..8598c5e647c 100644 --- a/pom.xml +++ b/pom.xml @@ -334,8 +334,8 @@ maven-compiler-plugin 3.1 - 1.6 - 1.6 + 1.7 + 1.7 true 512m true @@ -1007,7 +1007,7 @@ check-forbidden-test-apis - 1.6 + 1.7 true @@ -1197,16 +1197,14 @@ src/main/java/org/apache/lucene/**/X*.java - + + + compile + + check + + +