Skip to content

Commit e1b819f

Browse files
committed
base version
1 parent d11069a commit e1b819f

File tree

553 files changed

+130251
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+130251
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild
10+
*.so

.idea/caches/build_file_checksums.ser

584 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/CMakeLists.txt

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# For more information about using CMake with Android Studio, read the
2+
# documentation: https://d.android.com/studio/projects/add-native-code.html
3+
4+
# Sets the minimum version of CMake required to build the native library.
5+
6+
cmake_minimum_required(VERSION 3.4.1)
7+
8+
# Creates and names a library, sets it as either STATIC
9+
# or SHARED, and provides the relative paths to its source code.
10+
# You can define multiple libraries, and CMake builds them for you.
11+
# Gradle automatically packages shared libraries with your APK.
12+
13+
add_library( # Sets the name of the library.
14+
native-lib
15+
16+
# Sets the library as a shared library.
17+
SHARED
18+
19+
# Provides a relative path to your source file(s).
20+
src/main/cpp/native-lib.cpp )
21+
22+
#Includes node's header files.
23+
include_directories(libnode/include/node/)
24+
25+
add_library( libnode
26+
SHARED
27+
IMPORTED )
28+
29+
set_target_properties( # Specifies the target library.
30+
libnode
31+
32+
# Specifies the parameter you want to define.
33+
PROPERTIES IMPORTED_LOCATION
34+
35+
# Provides the path to the library you want to import.
36+
${CMAKE_SOURCE_DIR}/libnode/bin/${ANDROID_ABI}/libnode.so )
37+
38+
# Searches for a specified prebuilt library and stores the path as a
39+
# variable. Because CMake includes system libraries in the search path by
40+
# default, you only need to specify the name of the public NDK library
41+
# you want to add. CMake verifies that the library exists before
42+
# completing its build.
43+
44+
find_library( # Sets the name of the path variable.
45+
log-lib
46+
47+
# Specifies the name of the NDK library that
48+
# you want CMake to locate.
49+
log )
50+
51+
# Specifies libraries CMake should link to your target library. You
52+
# can link multiple libraries, such as libraries you define in this
53+
# build script, prebuilt third-party libraries, or system libraries.
54+
55+
target_link_libraries( # Specifies the target library.
56+
native-lib
57+
58+
libnode
59+
60+
# Links the target library to the log library
61+
# included in the NDK.
62+
${log-lib} )

app/build.gradle

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
buildToolsVersion "28.0.3"
6+
defaultConfig {
7+
applicationId "com.yourorg.sample"
8+
minSdkVersion 19
9+
targetSdkVersion 28
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
externalNativeBuild {
14+
cmake {
15+
cppFlags ""
16+
arguments "-DANDROID_STL=c++_shared"
17+
}
18+
}
19+
ndk {
20+
abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
21+
}
22+
}
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
externalNativeBuild {
30+
cmake {
31+
path "CMakeLists.txt"
32+
}
33+
}
34+
35+
// If you want Gradle to package prebuilt native libraries
36+
// with your APK, modify the default source set configuration
37+
// to include the directory of your prebuilt .so files as follows.
38+
sourceSets {
39+
main {
40+
jniLibs.srcDirs 'libnode/bin/'
41+
}
42+
}
43+
}
44+
45+
dependencies {
46+
compile fileTree(dir: 'libs', include: ['*.jar'])
47+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
48+
exclude group: 'com.android.support', module: 'support-annotations'
49+
})
50+
compile 'com.android.support:appcompat-v7:25.3.1'
51+
compile 'com.android.support.constraint:constraint-layout:1.0.2'
52+
testCompile 'junit:junit:4.12'
53+
}
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 1995, 1999
3+
* Berkeley Software Design, Inc. All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
* 1. Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
*
11+
* THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
12+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14+
* ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
15+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
17+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
20+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21+
* SUCH DAMAGE.
22+
*
23+
* BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
24+
*/
25+
26+
#ifndef _IFADDRS_H_
27+
#define _IFADDRS_H_
28+
29+
struct ifaddrs {
30+
struct ifaddrs *ifa_next;
31+
char *ifa_name;
32+
unsigned int ifa_flags;
33+
struct sockaddr *ifa_addr;
34+
struct sockaddr *ifa_netmask;
35+
struct sockaddr *ifa_dstaddr;
36+
void *ifa_data;
37+
};
38+
39+
/*
40+
* This may have been defined in <net/if.h>. Note that if <net/if.h> is
41+
* to be included it must be included before this header file.
42+
*/
43+
#ifndef ifa_broadaddr
44+
#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
45+
#endif
46+
47+
#include <sys/cdefs.h>
48+
49+
__BEGIN_DECLS
50+
extern int getifaddrs(struct ifaddrs **ifap);
51+
extern void freeifaddrs(struct ifaddrs *ifa);
52+
__END_DECLS
53+
54+
#endif

app/libnode/include/node/chakra_ttd.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef SRC_CHAKRA_TTD_H_
2+
#define SRC_CHAKRA_TTD_H_
3+
4+
#if defined(NODE_ENGINE_CHAKRACORE)
5+
#define ENABLE_TTD_NODE 1
6+
#else
7+
#define ENABLE_TTD_NODE 0
8+
#endif
9+
10+
#if defined(ENABLE_TTD_NODE) && ENABLE_TTD_NODE
11+
extern bool s_doTTRecord;
12+
extern bool s_doTTReplay;
13+
extern bool s_doTTDebug;
14+
#endif
15+
16+
#endif // SRC_CHAKRA_TTD_H_

0 commit comments

Comments
 (0)