Skip to content

Commit

Permalink
feature: types & example
Browse files Browse the repository at this point in the history
  • Loading branch information
radko93 committed May 28, 2020
1 parent 389fcbb commit bfe096a
Show file tree
Hide file tree
Showing 65 changed files with 13,449 additions and 39 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
63 changes: 53 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,64 @@
# Sodium
/libsodium

# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
android/build
android/.externalNativeBuild
android/lib
*.iml
.idea
.gradle
local.properties
android.iml
android/.cxx

# Xcode
ios/build
project.xcworkspace
xcuserdata
# Cocoapods
#
example/ios/Pods

# OSX
# node.js
#
.DS_Store
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Expo
.expo/*

# generated by bob
lib/
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example/
38 changes: 24 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
// Buildscript is evaluated before everything else so we can't use getExtOrDefault

repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}

apply plugin: 'com.android.library'

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Libsodium_' + name]
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['Libsodium_' + name]).toInteger()
}

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')
defaultConfig {
minSdkVersion 16
compileSdkVersion 28
targetSdkVersion 28
versionCode 1
versionName "0.1"
minSdkVersion 16
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
arguments "-DANDROID_TOOLCHAIN=clang"
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Libsodium_compileSdkVersion=28
Libsodium_buildToolsVersion=28.0.3
Libsodium_targetSdkVersion=28
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
16 changes: 8 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ do
# --------------------------
platform=`uname`
if [ "$platform" == 'Darwin' ] && [ "$targetPlatform" == 'ios' ]; then
IOS_VERSION_MIN=6.0 dist-build/ios.sh
IOS_VERSION_MIN=9.0 dist-build/ios.sh
fi

# --------------------------
# Android build
# --------------------------
case $targetPlatform in
"arm-old")
dist-build/android-arm.sh
NDK_PLATFORM=android-21 dist-build/android-arm.sh
;;
"arm")
dist-build/android-armv7-a.sh
dist-build/android-armv8-a.sh
NDK_PLATFORM=android-21 dist-build/android-armv7-a.sh
NDK_PLATFORM=android-21 dist-build/android-armv8-a.sh
;;
"mips")
dist-build/android-mips32.sh
dist-build/android-mips64.sh
NDK_PLATFORM=android-21 dist-build/android-mips32.sh
NDK_PLATFORM=android-21 dist-build/android-mips64.sh
;;
"x86")
dist-build/android-x86.sh
dist-build/android-x86_64.sh
NDK_PLATFORM=android-21 dist-build/android-x86.sh
NDK_PLATFORM=android-21 dist-build/android-x86_64.sh
;;
esac

Expand Down
17 changes: 17 additions & 0 deletions example/android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions example/android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1
Loading

0 comments on commit bfe096a

Please sign in to comment.