Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]


Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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('?\\'):
Expand Down Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion mx_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down