Skip to content

Commit effc3d6

Browse files
author
ci_lynx
committed
[Infra] test mr
Don't merge issue: m-000
1 parent da5ed07 commit effc3d6

File tree

9 files changed

+1622
-37
lines changed

9 files changed

+1622
-37
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk bundle install --path .bundle
3131
- name: Lint
3232
run: |-
33-
POD_VERSION=0.0.1-for-ci-test bundle exec pod spec lint PrimJS.podspec --verbose --skip-import-validation --allow-warnings
33+
POD_VERSION=$${{ github.event.pull_request.head.sha }} bundle exec pod spec lint PrimJS.podspec --verbose --skip-import-validation --allow-warnings
3434
3535
check-unittests-linux:
3636
runs-on: lynx-ubuntu-22.04-medium

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ endif()
183183

184184
set(napi_v8_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/napi/v8/js_native_api_v8.cc)
185185

186+
set(napi_adapter_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/napi/adapter/js_native_api_adapter.cc)
187+
186188
include_directories(
187189
${CMAKE_CURRENT_SOURCE_DIR}/src
188190
${CMAKE_CURRENT_SOURCE_DIR}/src/interpreter
@@ -191,7 +193,8 @@ include_directories(
191193
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/env
192194
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/internal
193195
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/quickjs
194-
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/v8)
196+
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/v8
197+
${CMAKE_CURRENT_SOURCE_DIR}/src/napi/adapter)
195198

196199
set(JS_V8_HEADERS ${CMAKE_SOURCE_DIR}/../../third_party/v8/include)
197200

@@ -208,10 +211,13 @@ if(NOT (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}))
208211
set(napi_v8_sources
209212
${napi_v8_sources}
210213
PARENT_SCOPE)
214+
set(napi_adapter_sources
215+
${napi_adapter_sources}
216+
PARENT_SCOPE)
211217
endif()
212218

213219
set_source_files_properties(
214-
${napi_sources} ${napi_v8_sources}
220+
${napi_sources} ${napi_v8_sources} ${napi_adapter_sources}
215221
PROPERTIES
216222
COMPILE_FLAGS
217223
"${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
@@ -233,13 +239,15 @@ if(ENABLE_BUILD_AAR)
233239
add_library(quick SHARED ${quickjs_sources})
234240
add_library(napi SHARED ${napi_sources})
235241
add_library(napi_v8 SHARED ${napi_v8_sources})
242+
add_library(napi_adapter SHARED ${napi_adapter_sources})
236243
find_library(log_lib log)
237244
target_link_libraries(quick ${log_lib})
238245
target_link_libraries(napi quick)
239246
target_link_libraries(napi ${log_lib})
240247
target_include_directories(napi_v8 PRIVATE ${JS_V8_HEADERS})
241248
target_link_libraries(
242249
napi_v8 PUBLIC ${JS_V8_LIBRARY}/${ANDROID_ABI}/libv8_libfull.cr.so)
250+
target_link_libraries(napi_adapter napi)
243251
endif()
244252

245253
if(WIN32)

PrimJS.podspec

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111

1212
Pod::Spec.new do |s|
1313
s.name = "PrimJS"
14-
s.version = "#{ ENV['POD_VERSION'] || File.read('PRIMJS_VERSION').strip}"
14+
s.version = begin
15+
raw_version = ENV['POD_VERSION'] || File.read('PRIMJS_VERSION').strip
16+
if raw_version.match?(/^[0-9a-f]{40}$/i)
17+
"0.0.1-for-ci-test"
18+
else
19+
raw_version
20+
end
21+
end
1522
s.summary = "A short description of PrimJS."
1623
s.homepage = "https://github.com/lynx-family/primjs"
1724

@@ -28,8 +35,13 @@ Pod::Spec.new do |s|
2835
s.license = "MIT"
2936
s.author = { "pandazyp" => "[email protected]" }
3037

31-
s.source = { :git => "https://github.com/lynx-family/primjs.git", :tag => s.version.to_s }
32-
38+
s.source = { :git => "https://github.com/lynx-family/primjs.git", }.tap do |source_hash|
39+
if ENV['POD_VERSION'] =~ /^[0-9a-f]{40}$/i
40+
source_hash[:commit] = ENV['POD_VERSION']
41+
else
42+
source_hash[:tag] = s.version.to_s
43+
end
44+
end
3345
s.compiler_flags = "-Wall", "-Wno-shorten-64-to-32", "-Os"
3446
s.ios.deployment_target = "9.0"
3547
s.pod_target_xcconfig = {
@@ -115,6 +127,13 @@ Pod::Spec.new do |s|
115127
ssp.dependency "PrimJS/quickjs"
116128
ssp.frameworks = "JavaScriptCore"
117129
end
130+
131+
sp.subspec "adapter" do |ssp|
132+
ssp.source_files = "src/napi/adapter/*.{h,cc}"
133+
ssp.public_header_files = "src/napi/adapter/js_native_api_adapter.h"
134+
ssp.dependency "PrimJS/napi/core"
135+
ssp.dependency "PrimJS/napi/env"
136+
end
118137
end
119138

120139
s.subspec "log" do |sp|

src/napi/adapter/BUILD.gn

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2024 The Lynx Authors. All rights reserved.
2+
# Licensed under the Apache License Version 2.0 that can be found in the
3+
# LICENSE file in the root directory of this source tree.
4+
5+
import("//Primjs.gni")
6+
config("config") {
7+
include_dirs = [ "." ]
8+
}
9+
10+
napi_source_set("adapter") {
11+
sources = [ "js_native_api_adapter.cc" ]
12+
public = [ "./js_native_api_adapter.h" ]
13+
public_configs = [ ":config" ]
14+
public_deps = [ "../..:napi_lib" ]
15+
}

0 commit comments

Comments
 (0)