Skip to content
Open
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
42 changes: 36 additions & 6 deletions LiquidCore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

import groovy.json.JsonSlurper
import org.gradle.api.attributes.Usage

def getVersionFromNpm() {
def inputFile = file("../package.json")
Expand All @@ -21,12 +22,18 @@ static def getVersionCode(vn) {
}

android {
compileSdkVersion 28
namespace "org.liquidplayer.node"

compileSdkVersion 35
ndkVersion "21.4.7075529"

buildFeatures {
buildConfig true
}

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 35
versionName getVersionFromNpm()
versionCode = getVersionCode(versionName)

Expand Down Expand Up @@ -113,11 +120,15 @@ afterEvaluate {
}

task copyHeadersToAARRelease(type: Zip) {
baseName = 'liquidcore-Nodejs-release'
extension = 'aar.in'
destinationDir = file('build/outputs/aar')
archiveBaseName = 'liquidcore-Nodejs-release'
archiveExtension = 'aar.in'
destinationDirectory = file('build/outputs/aar')
def aarNameO = "build/outputs/aar/liquidcore-Nodejs-release.aar"

// Store the AAR without compression to align it later
entryCompression = ZipEntryCompression.STORED
zip64 = true

from zipTree(aarNameO)
from("../deps/node-10.15.3/deps/cares/include") {
into('include/cares')
Expand Down Expand Up @@ -154,11 +165,28 @@ task renameAARRelease (type: Copy) {
rename "liquidcore-Nodejs-release.aar.in", "liquidcore-Nodejs-release.aar"
}

task zipAlignAARRelease(type: Exec) {
dependsOn renameAARRelease

def zipalign = "${android.sdkDirectory}/build-tools/${android.buildToolsVersion}/zipalign"
def inputAar = "$buildDir/outputs/aar/liquidcore-Nodejs-release.aar"
def outputAar = "$buildDir/outputs/aar/liquidcore-Nodejs-release-aligned.aar"

// Use zipalign to align to 16KB (16384 bytes)
commandLine zipalign, '-f', '-p', '16384', inputAar, outputAar

doLast {
file(inputAar).delete()
file(outputAar).renameTo(file(inputAar))
}
}

afterEvaluate {
if (project.hasProperty("bundleReleaseAar")) {
bundleReleaseAar.finalizedBy copyHeadersToAARRelease
copyHeadersToAARRelease.finalizedBy renameAARRelease
renameAARRelease.finalizedBy removeOldAARRelease
removeOldAARRelease.finalizedBy zipAlignAARRelease
}
}
/*
Expand Down Expand Up @@ -190,3 +218,5 @@ publishing {
}
}
*/

// apply from: new File(rootProject.projectDir, '.liquidcore/liquidcore.build.gradle')
3 changes: 1 addition & 2 deletions LiquidCore/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.liquidplayer.node" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
6 changes: 5 additions & 1 deletion LiquidCore/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.22.1)
project(LiquidCoreNodejs)

set( SOURCES
# cares
Expand Down Expand Up @@ -824,6 +825,9 @@ endif()

add_library( liquidnode SHARED ${SOURCES} )

target_link_options(liquidnode PRIVATE "-Wl,-z,max-page-size=16384")
target_link_options(liquidnode PRIVATE "-Wl,-z,common-page-size=16384")

if(${ANDROID_ABI} STREQUAL armeabi-v7a)
SET( SSL_ARCH "linux-armv4" )
SET( NODE_ARCH "armv7a" )
Expand Down
37 changes: 30 additions & 7 deletions LiquidV8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

import groovy.json.JsonSlurper
import org.gradle.api.attributes.Usage

def getVersionFromNpm() {
def inputFile = file("../package.json")
Expand All @@ -21,12 +22,13 @@ static def getVersionCode(vn) {
}

android {
compileSdkVersion 28

namespace 'org.liquidplayer.javascript'
compileSdkVersion 35
ndkVersion "21.4.7075529"

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 35
versionName getVersionFromNpm()
versionCode = getVersionCode(versionName)

Expand Down Expand Up @@ -73,11 +75,15 @@ dependencies {
}

task copyHeadersToAARRelease(type: Zip) {
baseName = 'liquidcore-V8-release'
extension = 'aar.in'
destinationDir = file('build/outputs/aar')
archiveBaseName = 'liquidcore-V8-release'
archiveExtension = 'aar.in'
destinationDirectory = file('build/outputs/aar')
def aarNameO = "build/outputs/aar/liquidcore-V8-release.aar"

// Store the AAR without compression to align it later
entryCompression = ZipEntryCompression.STORED
zip64 = true

from zipTree(aarNameO)
from("../deps/node-10.15.3/deps/v8/include") {
into('include/v8')
Expand All @@ -102,11 +108,28 @@ task renameAARRelease (type: Copy) {
rename "liquidcore-V8-release.aar.in", "liquidcore-V8-release.aar"
}

task zipAlignAARRelease(type: Exec) {
dependsOn renameAARRelease

def zipalign = "${android.sdkDirectory}/build-tools/${android.buildToolsVersion}/zipalign"
def inputAar = "$buildDir/outputs/aar/liquidcore-V8-release.aar"
def outputAar = "$buildDir/outputs/aar/liquidcore-V8-release-aligned.aar"

// Use zipalign to align to 16KB (16384 bytes)
commandLine zipalign, '-f', '-p', '16384', inputAar, outputAar

doLast {
file(inputAar).delete()
file(outputAar).renameTo(file(inputAar))
}
}

afterEvaluate {
if (project.hasProperty("bundleReleaseAar")) {
bundleReleaseAar.finalizedBy copyHeadersToAARRelease
copyHeadersToAARRelease.finalizedBy renameAARRelease
renameAARRelease.finalizedBy removeOldAARRelease
removeOldAARRelease.finalizedBy zipAlignAARRelease
}
}
/*
Expand Down
3 changes: 1 addition & 2 deletions LiquidV8/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.liquidplayer.javascript" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
6 changes: 5 additions & 1 deletion LiquidV8/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.4.1)
cmake_minimum_required(VERSION 3.22.1)
project(LiquidCoreV8)

set( SOURCES
# Common V8 objects for JNI/JSC
Expand Down Expand Up @@ -500,6 +501,9 @@ endif()

add_library( liquidjs SHARED ${SOURCES} )

target_link_options(liquidjs PRIVATE "-Wl,-z,max-page-size=16384")
target_link_options(liquidjs PRIVATE "-Wl,-z,common-page-size=16384")

add_library(v8_base STATIC IMPORTED)
set_target_properties(
v8_base PROPERTIES IMPORTED_LOCATION
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:8.11.1'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
6 changes: 3 additions & 3 deletions deps/node-10.15.3/deps/openssl/openssl/crypto/mem_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

#define CLEAR(p, s) OPENSSL_cleanse(p, s)
#ifndef PAGE_SIZE
# define PAGE_SIZE 4096
# define PAGE_SIZE sysconf(_SC_PAGESIZE)
#endif
#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
# define MAP_ANON MAP_ANONYMOUS
Expand Down Expand Up @@ -432,12 +432,12 @@ static int sh_init(size_t size, int minsize)
long tmppgsize = sysconf(_SC_PAGESIZE);
# endif
if (tmppgsize < 1)
pgsize = PAGE_SIZE;
pgsize = getpagesize();
else
pgsize = (size_t)tmppgsize;
}
#else
pgsize = PAGE_SIZE;
pgsize = getpagesize();
#endif
sh.map_size = pgsize + sh.arena_size + pgsize;
if (1) {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048M
org.gradle.jvmargs=-Xmx2048M
android.useAndroidX=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Sep 01 06:26:13 BRT 2019
#Sun Jul 21 11:26:13 BRT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
Loading