From a488a6027387b66c32bc693ab85ef7e5665af956 Mon Sep 17 00:00:00 2001 From: JornVernee Date: Tue, 13 Nov 2018 17:41:10 +0100 Subject: [PATCH 1/5] First attempt at adding windows support for travis. travis script v2 moved language and python tags into linux specific job tar is installed by default on windows (apparently) jre -> jdk set path in bash set language Debug python installation try explicit install again typo typo Without install script check pylint version in powershell Simplified script maybe installing openssl will work? Nope. testing minimal example Revert "testing minimal example" This reverts commit 15f0ed8dc12f587ad074834324fa91b28d441b46. Try other SO suggestion Turn off verification for now Didn't work try another package Nope --- .travis.yml | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index daa38f2b..2e0d5d42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,7 @@ -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 @@ -16,4 +9,30 @@ install: export ECLIPSE_EXE=$TRAVIS_BUILD_DIR/../eclipse/eclipse 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 + script: powershell .\\mx.cmd --strict-compliance gate --strict-mode \ No newline at end of file From 71e90f61594e27d36afe1948dc72fa3921e41ef3 Mon Sep 17 00:00:00 2001 From: JornVernee Date: Sun, 2 Dec 2018 11:11:16 +0100 Subject: [PATCH 2/5] add http as fallback url --- mx.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mx.py b/mx.py index dde2abee..0f5af314 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 ] From ffb3165a92d8a49198743d3ee41df61e86a4ccda Mon Sep 17 00:00:00 2001 From: JornVernee Date: Sun, 2 Dec 2018 11:25:28 +0100 Subject: [PATCH 3/5] safe path eclipse_exe --- mx.py | 5 ++++- mx_gate.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mx.py b/mx.py index 0f5af314..2874fbae 100755 --- a/mx.py +++ b/mx.py @@ -11956,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): @@ -13627,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('?\\'): 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') From a742b2221f627d9a38a2ad413280f67264d2b371 Mon Sep 17 00:00:00 2001 From: JornVernee Date: Sun, 2 Dec 2018 11:35:43 +0100 Subject: [PATCH 4/5] add exe suffix --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e0d5d42..b55f7fec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ install: 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 @@ -21,7 +21,6 @@ jobs: apt: packages: - oracle-java8-installer - script: ./mx --strict-compliance gate --strict-mode - name: Windows os: windows @@ -35,4 +34,5 @@ jobs: 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 From b14b3cff0e58c624c054542366a749759dd03cf9 Mon Sep 17 00:00:00 2001 From: JornVernee Date: Sun, 2 Dec 2018 12:10:35 +0100 Subject: [PATCH 5/5] convert custom eclipse path too --- mx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mx.py b/mx.py index 2874fbae..327f3a12 100755 --- a/mx.py +++ b/mx.py @@ -16009,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':