aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-10-11 22:26:37 +0200
committerGitHub <noreply@github.com>2017-10-11 22:26:37 +0200
commit9c75a2a26a2b704ee8895ae298e5bff3e78acc70 (patch)
treefb9d71e2a09d58cbb669712304482c3f8e7910dc /scripts
parenta0c7dafe28957cc45e428ba47a8e6f26e52499bd (diff)
downloadbrotli-9c75a2a26a2b704ee8895ae298e5bff3e78acc70.zip
brotli-9c75a2a26a2b704ee8895ae298e5bff3e78acc70.tar.gz
brotli-9c75a2a26a2b704ee8895ae298e5bff3e78acc70.tar.bz2
Use bazel in appveyor (#612)
+publish jni dll
Diffstat (limited to 'scripts')
-rw-r--r--scripts/appveyor.yml16
-rw-r--r--scripts/fix-win-bazel-build.py31
2 files changed, 45 insertions, 2 deletions
diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml
index 2c98f19..a825b22 100644
--- a/scripts/appveyor.yml
+++ b/scripts/appveyor.yml
@@ -26,6 +26,8 @@ environment:
- BUILD_SYSTEM: make
ARCH: "x86_64"
+ - BUILD_SYSTEM: bazel
+
install:
- IF "%BUILD_SYSTEM%"=="Python" (
SET "PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" &&
@@ -39,14 +41,17 @@ install:
SET "TOOLCHAIN=x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64"
)
)
+- IF "%BUILD_SYSTEM%"=="bazel" (
+ appveyor DownloadFile https://github.com/bazelbuild/bazel/releases/download/0.6.1/bazel-0.6.1-windows-x86_64.exe -FileName bazel.exe
+ )
before_build:
+- FOR /f %%i in ('C:\cygwin64\bin\date.exe +%%Y-%%m-%%d') DO SET "RELEASE_DATE=%%i"
- IF "%BUILD_SYSTEM%"=="CMake" ( mkdir builddir && cd builddir && cmake -G "%GENERATOR%" .. )
- IF "%BUILD_SYSTEM%"=="make" (
SET "CC=gcc" &&
SET "PATH=C:\mingw-w64\%TOOLCHAIN%\bin;%PATH%" &&
- COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\%TOOLCHAIN%\bin\make.exe &&
- FOR /f %%i in ('C:\cygwin64\bin\date.exe +%%Y-%%m-%%d') DO SET "RELEASE_DATE=%%i"
+ COPY C:\msys64\usr\bin\make.exe C:\mingw-w64\%TOOLCHAIN%\bin\make.exe
)
build_script:
@@ -57,11 +62,18 @@ build_script:
cd bin && 7z a -tzip -mx9 brotli-win-%ARCH%-%RELEASE_DATE%.zip brotli.exe &&
appveyor PushArtifact brotli-win-%ARCH%-%RELEASE_DATE%.zip && cd ..
)
+- IF "%BUILD_SYSTEM%"=="bazel" (
+ bazel --batch build -c opt java/org/brotli/wrapper/...:all &&
+ python scripts/fix-win-bazel-build.py &&
+ cd bazel-bin && 7z a -tzip -mx9 brotli-win-bazel-jni-%RELEASE_DATE%.zip brotli_jni.dll &&
+ appveyor PushArtifact brotli-win-bazel-jni-%RELEASE_DATE%.zip && cd ..
+ )
test_script:
- IF "%BUILD_SYSTEM%"=="CMake" ( ctest --output-on-failure --interactive-debug-mode 0 -C Debug )
- IF "%BUILD_SYSTEM%"=="Python" ( python setup.py test )
- IF "%BUILD_SYSTEM%"=="make" ( sh -c "make test" )
+- IF "%BUILD_SYSTEM%"=="bazel" ( bazel --batch test -c opt --test_output streamed java/org/brotli/wrapper/...:all )
deploy:
- provider: BinTray
diff --git a/scripts/fix-win-bazel-build.py b/scripts/fix-win-bazel-build.py
new file mode 100644
index 0000000..fcba6f3
--- /dev/null
+++ b/scripts/fix-win-bazel-build.py
@@ -0,0 +1,31 @@
+import fnmatch
+import os
+import os.path
+from shutil import copyfile
+
+matches = []
+for root, dirnames, filenames in os.walk('bazel-bin\\java\\org\\brotli'):
+ for filename in fnmatch.filter(filenames, '*.runfiles_manifest'):
+ matches.append(os.path.join(root, filename))
+
+for match in matches:
+ runfiles = match[:-len('_manifest')]
+ with open(match) as manifest:
+ for entry in manifest:
+ entry = entry.strip()
+ if not entry.startswith("org_brotli"):
+ continue
+ if entry.startswith('org_brotli/external'):
+ continue
+ (alias, space, link) = entry.partition(' ')
+ if alias.endswith('.jar') or alias.endswith('.exe'):
+ continue
+ link = link.replace('/', '\\')
+ alias = alias.replace('/', '\\')
+ dst = os.path.join(runfiles, alias)
+ if not os.path.exists(dst):
+ print(link + ' -> ' + dst)
+ parent = os.path.dirname(dst)
+ if not os.path.exists(parent):
+ os.makedirs(parent)
+ copyfile(link, dst)