cmake_vars = cmu.setAllVars(config) # NOTE: uses Python string interpolation (see: https://stackoverflow.com/a/4450610) return \ u.mkdir(u.cmake_out_dir) + \ ["cd " + u.cmake_out_dir] + \ u.rm("CMakeCache.txt CMakeFiles/") + \ ["""cmake \ -DCMAKE_BUILD_TYPE=Release \ %(cmake_vars)s \ ../../ \ """ % locals()] macos_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake) #----------------------------------------------------------------------- macos_config.build_step(c.build_j2v8_jni, u.build_j2v8_jni) #----------------------------------------------------------------------- def build_j2v8_cpp(config): return [ "cd " + u.cmake_out_dir, "make -j4", ] macos_config.build_step(c.build_j2v8_cpp, build_j2v8_cpp) #----------------------------------------------------------------------- j.add_java_build_step(macos_config) #----------------------------------------------------------------------- j.add_java_test_step(macos_config) #-----------------------------------------------------------------------
""" % locals()] win32_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake) #----------------------------------------------------------------------- win32_config.build_step(c.build_j2v8_jni, u.build_j2v8_jni) #----------------------------------------------------------------------- def build_j2v8_cpp(config): # show docker container memory usage / limit show_mem = ["powershell C:/j2v8/docker/win32/mem.ps1" ] if config.cross_agent == "docker" else [] return \ show_mem + \ [ "cd " + u.cmake_out_dir, "msbuild j2v8.sln /property:Configuration=Release", ] + \ show_mem win32_config.build_step(c.build_j2v8_cpp, build_j2v8_cpp) #----------------------------------------------------------------------- j.add_java_build_step(win32_config) #----------------------------------------------------------------------- j.add_java_test_step(win32_config) #-----------------------------------------------------------------------
["""cmake \ ../../ \ %(cmake_vars)s \ %(cmake_pdb_fix_flag)s \ -G"Visual Studio 14 2015%(cmake_gen_suffix)s" """ % locals()] win32_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake) #----------------------------------------------------------------------- win32_config.build_step(c.build_j2v8_jni, u.build_j2v8_jni) #----------------------------------------------------------------------- def build_j2v8_cpp(config): # show docker container memory usage / limit show_mem = ["powershell C:/j2v8/docker/win32/mem.ps1"] if config.cross_agent == "docker" else [] return \ show_mem + \ [ "cd " + u.cmake_out_dir, "msbuild j2v8.sln /property:Configuration=Release", ] + \ show_mem win32_config.build_step(c.build_j2v8_cpp, build_j2v8_cpp) #----------------------------------------------------------------------- j.add_java_build_step(win32_config) #----------------------------------------------------------------------- j.add_java_test_step(win32_config) #-----------------------------------------------------------------------
u.mkdir(u.cmake_out_dir) + \ ["cd " + u.cmake_out_dir] + \ u.rm("CMakeCache.txt CMakeFiles/") + \ ["""cmake \ -DCMAKE_BUILD_TYPE=Release \ %(cmake_vars)s \ ../../ \ """ % locals()] macos_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake) #----------------------------------------------------------------------- macos_config.build_step(c.build_j2v8_jni, u.build_j2v8_jni) #----------------------------------------------------------------------- def build_j2v8_cpp(config): return [ "cd " + u.cmake_out_dir, "make -j4", ] macos_config.build_step(c.build_j2v8_cpp, build_j2v8_cpp) #----------------------------------------------------------------------- j.add_java_build_step(macos_config) #----------------------------------------------------------------------- j.add_java_test_step(macos_config) #-----------------------------------------------------------------------
linux_config.build_step(c.build_j2v8_cmake, build_j2v8_cmake) #----------------------------------------------------------------------- linux_config.build_step(c.build_j2v8_jni, u.build_j2v8_jni) #----------------------------------------------------------------------- def build_j2v8_cpp(config): return [ "cd " + u.cmake_out_dir, "make -j4", ] linux_config.build_step(c.build_j2v8_cpp, build_j2v8_cpp) #----------------------------------------------------------------------- def build_j2v8_optimize(config): # NOTE: execstack / strip are not part of the alpine tools, therefore we just skip this step if config.vendor == c.vendor_alpine: return ["echo Skipped..."] lib_path = u.outputLibPath(config) return [ "execstack -c " + lib_path, "strip --strip-unneeded -R .note -R .comment " + lib_path, ] linux_config.build_step(c.build_j2v8_optimize, build_j2v8_optimize) #----------------------------------------------------------------------- j.add_java_build_step(linux_config) #----------------------------------------------------------------------- j.add_java_test_step(linux_config) #-----------------------------------------------------------------------