Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme #465

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5056374
Update the .classpath file to Java 6
irbull Oct 9, 2018
2fd738b
Remove the text relocation from the build
irbull Dec 23, 2018
bc2aa66
Remove unused build scripts
irbull Dec 23, 2018
a3fabba
Create a gitlab ci build for J2V8
irbull Jan 7, 2019
b67ce79
Set the cross-compiling flag on Node builds
irbull Jan 10, 2019
1aadfc1
Support 64-bit Android builds
irbull Jan 10, 2019
5ae835c
Use API Level 21 to build
irbull Jan 10, 2019
82e0141
Fix download links that currently gives 404 to use http://archive.apa…
Nov 3, 2017
85ee122
Enable emulator tests for ARM
irbull Jan 11, 2019
f488305
No longer pipe ARM build output to a file
irbull Jan 11, 2019
4d56e03
Use the quite flag when the build unzips the android platform
irbull Jan 11, 2019
5a375e5
Reduce build log even more
irbull Jan 11, 2019
5a1c947
Fail the build if tests are failing
irbull Jan 15, 2019
f35bd2a
No longer allocates empty ByteBuffers in native code
irbull Jan 15, 2019
35ef28c
Skip OS Specific tests when running on the emulator
irbull Jan 15, 2019
a6065a6
Ignore some tests that are failing on the emulator
irbull Jan 15, 2019
45a8c68
Enable builds for all 4 platforms
irbull Jan 15, 2019
3d2a65c
Pipe all results of the build command to a file
irbull Jan 15, 2019
f09d023
Auto deploy master to maven snapshot on each commit
irbull Jan 15, 2019
cf42b73
Fix the redirect of standard err to standard out
irbull Jan 15, 2019
67b097e
Auto deploy artifacts to maven central
irbull Jan 15, 2019
8123956
No longer skips setup/teardown for android tests
irbull Jan 15, 2019
30e1700
No longer skips setup/teardown for android tests
irbull Jan 15, 2019
2de8cc7
Install bash during the deploy stage
irbull Jan 15, 2019
90e4000
Ignore testNestedExecutorExecution
irbull Jan 15, 2019
fca7238
Setup android tools in the gitlab ci file
irbull Jan 16, 2019
c763bdf
Add a deploy stage to the build
irbull Jan 16, 2019
6065ed0
Use the docker build for artifact release
irbull Jan 16, 2019
45e3d8d
Will not deploy during a separate stage
irbull Jan 16, 2019
6697c51
Remove the unused directory dep_includes_macosx
irbull Jan 16, 2019
4998bf8
Will not perform a release until all builds are finished
irbull Jan 16, 2019
f418375
Find the right container engine when running buids on MacOS
irbull Jan 18, 2019
b3b5ab7
Set the version to 4.8.3 on the 4.8 maintenance branch
irbull Jan 18, 2019
974063d
Uses volatile to fix the executor tests
irbull Jan 18, 2019
f108a42
Auto deploy the 4.8-maintenance branch
irbull Jan 18, 2019
0f237c1
Do not build the 4.8-maintenance without deploying
irbull Jan 18, 2019
102e245
Add a script to install the android dependencies and their licenses
irbull Jan 19, 2019
3f3644a
Wait 2 seconds in the executor tests
irbull Jan 19, 2019
e764532
Fix build status in README of 4.8-maintanance branch
Apr 29, 2019
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
3 changes: 2 additions & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
Expand All @@ -23,7 +24,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
83 changes: 83 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# The build image for all regulator projects is available at
# https://regulator.innoopract.com/build-tools/regulator-build-image
# Whenever changes are submitted to the master branch, the image is
# automatically built and uploaded to the projects container registry.
image: docker:18.06.1-ce-dind

variables:
DOCKER_HOST: tcp://localhost:2375/
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"

before_script:
- apk add --update python git gzip tar openjdk8 bash wget unzip libstdc++
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
- unzip -d android-sdk-linux android-sdk.zip
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
- chmod +x ./gradlew
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail

stages:
- build

services:
- name: docker:dind
entrypoint:
- dockerd-entrypoint.sh

maven_verify:
stage: build
script:
- docker info
- COMMIT_HASH=`git rev-parse HEAD` && sed -i "s/Unknown\ revision\ ID/$COMMIT_HASH/g" src/main/java/com/eclipsesource/v8/V8.java
- python nodejs.py git clone
- python nodejs.py diff apply
- python build.py -t android -a arm --docker all ~j2v8release > arm.txt 2>&1 && ! grep -q BUILD\ FAILED arm.txt && echo passed || exit 1
- python build.py -t android -a x86 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > x86.txt 2>&1 && ! grep -q BUILD\ FAILED x86.txt && echo passed || exit 1
- python build.py -t android -a x86_64 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > x86_64.txt 2>&1 && ! grep -q BUILD\ FAILED x86_64.txt && echo passed || exit 1
- python build.py -t android -a arm64 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > arm64.txt 2>&1 && ! grep -q BUILD\ FAILED arm64.txt && echo passed || exit 1
artifacts:
when: always
paths:
- build/outputs/aar/**
- arm.txt
- x86.txt
- x86_64.txt
- arm64.txt
- src/main/jniLibs/**/*
except:
- master
- 4.8-maintenance

maven_verify_deploy:
stage: build
script:
- docker info
- COMMIT_HASH=`git rev-parse HEAD` && sed -i "s/Unknown\ revision\ ID/$COMMIT_HASH/g" src/main/java/com/eclipsesource/v8/V8.java
- python nodejs.py git clone
- python nodejs.py diff apply
- python build.py -t android -a arm --docker all ~j2v8release > arm.txt 2>&1 && ! grep -q BUILD\ FAILED arm.txt && echo passed || exit 1
- python build.py -t android -a x86 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > x86.txt 2>&1 && ! grep -q BUILD\ FAILED x86.txt && echo passed || exit 1
- python build.py -t android -a x86_64 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > x86_64.txt 2>&1 && ! grep -q BUILD\ FAILED x86_64.txt && echo passed || exit 1
- python build.py -t android -a arm64 --keep-native-libs --docker nodejs j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java > arm64.txt 2>&1 && ! grep -q BUILD\ FAILED arm64.txt && echo passed || exit 1
- python build.py -t android -a arm j2v8release --keep-native-libs --docker
artifacts:
when: always
paths:
- build/outputs/aar/**
- arm.txt
- x86.txt
- x86_64.txt
- arm64.txt
- src/main/jniLibs/**/*
only:
- master
- 4.8-maintenance
10 changes: 10 additions & 0 deletions .m2/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<id>snapshots</id>
<username>${env.MAVEN_REPO_USER}</username>
<password>${env.MAVEN_REPO_PASS}</password>
</server>
</servers>
</settings>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
J2V8
====

[![Build Status](https://secure.travis-ci.org/eclipsesource/J2V8.png)](http://travis-ci.org/eclipsesource/J2V8)
[![Build Status](https://travis-ci.org/eclipsesource/J2V8.svg?branch=4.8-maintenance)](https://travis-ci.org/eclipsesource/J2V8)
[![Maven Central](https://img.shields.io/maven-central/v/com.eclipsesource.j2v8/j2v8_win32_x86.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.eclipsesource.j2v8%22)

J2V8 is a set of Java bindings for V8. J2V8 focuses on performance and tight integration with V8. It also takes a 'primitive first' approach, meaning that if a value can be accessed as a primitive, then it should be. This forces a more static type system between the JS and Java code, but it also improves the performance since intermediate Objects are not created.
Expand Down
4 changes: 0 additions & 4 deletions build-node.sh

This file was deleted.

16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'signing'

group = 'com.eclipsesource.j2v8'
archivesBaseName = 'j2v8'
version = '4.8.2'
version = '4.8.3-SNAPSHOT'

configurations {
archives {
Expand Down Expand Up @@ -81,21 +81,21 @@ spoon {
}

signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
//required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
//sign configurations.archives
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
//beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: project.hasProperty('ossrhUsername')?ossrhUsername:'', password: project.hasProperty('ossrhPassword')?ossrhPassword:'')
}
//repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
//authentication(userName: project.hasProperty('ossrhUsername')?ossrhUsername:'', password: project.hasProperty('ossrhPassword')?ossrhPassword:'')
//}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: project.hasProperty('ossrhUsername')?ossrhUsername:'', password: project.hasProperty('ossrhPassword')?ossrhPassword:'')
authentication(userName: System.getenv("MAVEN_REPO_USER"), password: System.getenv("MAVEN_REPO_PASS") )
}

pom.project {
Expand Down
58 changes: 0 additions & 58 deletions buildAll.sh

This file was deleted.

3 changes: 3 additions & 0 deletions build_system/build_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
CLIStep(c.build_j2v8_java, " Compiles the Java source code and packages it, including the previously built native libraries, into the final package artifacts.\n" +
" For the execution of this build-step Maven (Java) or Gradle (Android) are used for the respective target platforms."),
CLIStep(c.build_j2v8_test, " Runs the Java (JUnit/Gradle) unit tests."),
CLIStep(c.build_j2v8_release, " Release J2V8."),
]

# build_steps_help = dict(atomic_build_steps)
Expand Down Expand Up @@ -61,6 +62,8 @@

avail_architectures = [
c.arch_x86,
c.arch_x86_64,
c.arch_x64,
c.arch_arm,
c.arch_arm64
]
2 changes: 1 addition & 1 deletion build_system/build_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# J2V8 settings
#-----------------------------------------------------------------------

J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 4, 8, 2
J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 4, 8, 3
J2V8_VERSION_SUFFIX = "-SNAPSHOT"

# The J2V8 version in the format {major.minor.patch} to be used in other build & utility scripts
Expand Down
27 changes: 22 additions & 5 deletions build_system/config_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cmake_utils as cmu
import os

android_config = PlatformConfig(c.target_android, [c.arch_x86, c.arch_arm])
android_config = PlatformConfig(c.target_android, [c.arch_x86, c.arch_arm, c.arch_arm64, c.arch_x86_64])

android_config.set_cross_configs({
"docker": DockerBuildStep(
Expand All @@ -22,23 +22,32 @@

android_config.set_file_abis({
c.arch_arm: "armeabi-v7a",
c.arch_x86: "x86"
c.arch_x86: "x86",
c.arch_x86_64: "x86_64",
c.arch_arm64: "arm64-v8a"
})

#-----------------------------------------------------------------------
def build_node_js(config):
arch = config.inject_env("$ARCH")
if ("x86_64" in arch):
os.environ['DEST_CPU'] = "x64"
else:
os.environ['DEST_CPU'] = arch
return [
"""android-gcc-toolchain $ARCH --api 17 --host gcc-lpthread -C \
"""android-gcc-toolchain $ARCH --api 21 --host gcc-lpthread -C \
sh -c \" \\
cd ./node; \\
./configure \\
--without-intl \\
--cross-compiling \\
--without-inspector \\
--dest-cpu=$ARCH \\
--dest-cpu=$DEST_CPU \\
--dest-os=$PLATFORM \\
--openssl-no-asm \\
--without-snapshot \\
--enable-static && \\
CFLAGS=-fPIC CXXFLAGS=-fPIC make -j4\" \
CFLAGS=-fPIC CXXFLAGS=-fPIC make -j4 \" \
""",
]

Expand Down Expand Up @@ -123,3 +132,11 @@ def build_j2v8_test(config):

android_config.build_step(c.build_j2v8_test, build_j2v8_test)
#-----------------------------------------------------------------------
def build_j2v8_release(config):
return \
u.setVersionEnv(config) + \
u.gradle(" uploadArchives")

android_config.build_step(c.build_j2v8_release, build_j2v8_release)
#-----------------------------------------------------------------------

3 changes: 3 additions & 0 deletions build_system/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# target architectures
arch_x86 = 'x86'
arch_x64 = 'x64'
arch_x86_64 = 'x86_64'
arch_arm = 'arm'
arch_arm64 = 'arm64'

# atomic build-steps
build_node_js = 'nodejs'
Expand All @@ -22,6 +24,7 @@
build_j2v8_optimize = 'j2v8optimize'
build_j2v8_java = 'j2v8java'
build_j2v8_test = 'j2v8test'
build_j2v8_release = 'j2v8release'

# aliases
build_java = 'java'
Expand Down
13 changes: 8 additions & 5 deletions build_system/docker_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
import subprocess
import sys
import platform

from build_structures import BuildSystem, BuildStep
import constants as c
Expand Down Expand Up @@ -31,19 +32,21 @@ def health_check(self, config):
# NOTE: the additional newlines are important for the regex matching
version_str = utils.execute_to_str("docker version") + "\n\n"

server_match = re.search(r"Server:(.*)\n\n", version_str + "\n\n", re.DOTALL)
docker_version_match = re.search(r"Client:(.*)\n\n", version_str + "\n\n", re.DOTALL)

if (server_match is None or server_match.group(1) is None):
if (docker_version_match is None or docker_version_match.group(1) is None):
utils.cli_exit("ERROR: Unable to determine docker server version from version string: \n\n" + version_str)

version_match = re.search(r"^ OS/Arch:\s+(.*)$", server_match.group(1), re.MULTILINE)
version_match = re.search(r"OS/Arch:\s+(.*)$", docker_version_match.group(1), re.MULTILINE)

if (version_match is None):
utils.cli_exit("ERROR: Unable to determine docker server platform from version string: \n\n" + version_str)

docker_version = version_match.group(1)

docker_req_platform = "windows" if utils.is_win32(config.platform) else "linux"
if (platform.system() == "Darwin"):
docker_req_platform = "darwin/amd64"

# check if the docker engine is running the expected container platform (linux or windows)
if (docker_req_platform not in docker_version):
Expand Down Expand Up @@ -103,7 +106,7 @@ def vendor_arg(value):
image_name = self.get_image_name(config)

print ("Building docker image: " + config.inject_env(image_name))
self.exec_host_cmd("docker build " + args_str + " -f $PLATFORM/Dockerfile -t \"" + image_name + "\" .", config)
self.exec_host_cmd("docker build " + args_str + " -f $PLATFORM/Dockerfile -t \"" + image_name + "\" . ", config)

def exec_build(self, config):
print ("DOCKER running " + config.platform + "@" + config.arch + " => " + config.name)
Expand All @@ -128,7 +131,7 @@ def exec_build(self, config):
image_name = self.get_image_name(config)
container_name = self.get_container_name(config)

docker_run_str = "docker run " + extra_options + " -P -v $CWD:" + mount_point + \
docker_run_str = "docker run " + extra_options + " -e MAVEN_REPO_USER=$MAVEN_REPO_USER -e MAVEN_REPO_PASS=$MAVEN_REPO_PASS -P -v $CWD:" + mount_point + \
" --name " + container_name + " " + image_name + " " + shell_invoke + " \"cd $BUILD_CWD" + cmd_separator + " " + build_cmd + "\""

docker_run_str = self.inject_env(docker_run_str, config)
Expand Down
Loading