diff --git a/.travis.yml b/.travis.yml index daa38f2b..b55f7fec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,38 @@ -language: python -python: - - "2.7" -addons: - apt: - packages: - - oracle-java8-installer install: - pip install astroid==1.1.0 - pip install pylint==1.1.0 - - pylint --version + - $POWERSHELL pylint --version - | export ECLIPSE_TAR=$TRAVIS_BUILD_DIR/../eclipse.tar.gz wget http://archive.eclipse.org/eclipse/downloads/drops4/R-4.5.2-201602121500/eclipse-SDK-4.5.2-linux-gtk-x86_64.tar.gz -O $ECLIPSE_TAR tar -C $TRAVIS_BUILD_DIR/.. -xf $ECLIPSE_TAR - export ECLIPSE_EXE=$TRAVIS_BUILD_DIR/../eclipse/eclipse + export ECLIPSE_EXE=$TRAVIS_BUILD_DIR/../eclipse/eclipse$EXE_SUFFIX export JDT=$TRAVIS_BUILD_DIR/ecj.jar wget http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.5.2-201602121500/ecj-4.5.2.jar -O $JDT -script: ./mx --strict-compliance gate --strict-mode + +jobs: + include: + - name: Linux + os: linux + language: python + python: + - "2.7" + addons: + apt: + packages: + - oracle-java8-installer + script: ./mx --strict-compliance gate --strict-mode + - name: Windows + os: windows + language: shell + before_install: + - choco install jdk8 -params 'installdir=C:\\jdk' -y + - choco install python2 --params '"/InstallDir:C:\Python27"' -y + - export PATH=$PATH:/c/Python27 + - export PATH=$PATH:/c/Python27/Scripts/ + - | + export JAVA_HOME=/c/jdk + export PATH=$PATH:$JAVA_HOME/bin + - export POWERSHELL=powershell + env: EXE_SUFFIX=.exe + script: powershell .\\mx.cmd --strict-compliance gate --strict-mode \ No newline at end of file diff --git a/mx.py b/mx.py index dde2abee..327f3a12 100755 --- a/mx.py +++ b/mx.py @@ -280,7 +280,8 @@ def cpu_count(): _repositories = dict() _mavenRepoBaseURLs = [ "https://repo1.maven.org/maven2/", - "https://search.maven.org/remotecontent?filepath=" + "https://search.maven.org/remotecontent?filepath=", + "http://repo1.maven.org/maven2/" #fall back to http ] @@ -11955,13 +11956,15 @@ def check_get_env(key): abort('Required environment variable ' + key + ' must be set') return value -def get_env(key, default=None): +def get_env(key, default=None, is_path=False): """ Gets an environment variable. :param default: default values if the environment variable is not set. :type default: str | None """ value = os.getenv(key, default) + if is_path: + value = _safe_path(value) return value def logv(msg=None): @@ -13626,6 +13629,7 @@ def _safe_path(path): https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath """ if get_os() == 'windows': + path = path.replace("/", "\\") if isabs(path): if path.startswith('\\\\'): if path[2:].startswith('?\\'): @@ -16005,7 +16009,7 @@ def processApDep(dep, edge): miscXml.open('option', attributes={'name' : 'projectSpecificProfile'}) miscXml.open('ProjectSpecificProfile') miscXml.element('option', attributes={'name' : 'formatter', 'value' : 'ECLIPSE'}) - custom_eclipse_exe = get_env('ECLIPSE_EXE') + custom_eclipse_exe = get_env('ECLIPSE_EXE', is_path=True) if custom_eclipse_exe: custom_eclipse = dirname(custom_eclipse_exe) if get_os() == 'darwin': diff --git a/mx_gate.py b/mx_gate.py index 3805d4cf..1a829295 100644 --- a/mx_gate.py +++ b/mx_gate.py @@ -527,7 +527,7 @@ def _run_gate(cleanArgs, args, tasks): with Task('CodeFormatCheck', tasks, tags=[Tags.style]) as t: if t: - eclipse_exe = mx.get_env('ECLIPSE_EXE') + eclipse_exe = mx.get_env('ECLIPSE_EXE', is_path=True) if eclipse_exe is not None: if mx.command_function('eclipseformat')(['-e', eclipse_exe, '--primary']) != 0: t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush')