Update Android build scripts. Remove unnecessary project files
This commit is contained in:
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
|
||||
|
||||
0
examples/android/ExampleAndroidApp/gradlew
vendored
Normal file → Executable file
0
examples/android/ExampleAndroidApp/gradlew
vendored
Normal file → Executable file
0
examples/android/ExampleAndroidApp/gradlew.bat
vendored
Executable file → Normal file
0
examples/android/ExampleAndroidApp/gradlew.bat
vendored
Executable file → Normal file
30
examples/python/zt.i
Normal file
30
examples/python/zt.i
Normal file
@@ -0,0 +1,30 @@
|
||||
/* libzt.i */
|
||||
|
||||
%begin
|
||||
%{
|
||||
#define SWIG_PYTHON_CAST_MODE
|
||||
%}
|
||||
|
||||
%include <stdint.i>
|
||||
|
||||
#define PYTHON_BUILD 1
|
||||
|
||||
%module libzt
|
||||
%{
|
||||
#include "../include/ZeroTier.h"
|
||||
#include "../include/ZeroTierConstants.h"
|
||||
%}
|
||||
|
||||
%define %cs_callback(TYPE, CSTYPE)
|
||||
%typemap(ctype) TYPE, TYPE& "void *"
|
||||
%typemap(in) TYPE %{ $1 = ($1_type)$input; %}
|
||||
%typemap(in) TYPE& %{ $1 = ($1_type)&$input; %}
|
||||
%typemap(imtype, out="IntPtr") TYPE, TYPE& "CSTYPE"
|
||||
%typemap(cstype, out="IntPtr") TYPE, TYPE& "CSTYPE"
|
||||
%typemap(csin) TYPE, TYPE& "$csinput"
|
||||
%enddef
|
||||
|
||||
%cs_callback(userCallbackFunc, CSharpCallback)
|
||||
|
||||
%include "../include/ZeroTier.h"
|
||||
%include "../include/ZeroTierConstants.h"
|
||||
5
examples/rust/binding-example/Cargo.lock
generated
Normal file
5
examples/rust/binding-example/Cargo.lock
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "binding-example"
|
||||
version = "0.1.0"
|
||||
10
examples/rust/binding-example/Cargo.toml
Normal file
10
examples/rust/binding-example/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "binding-example"
|
||||
version = "0.1.0"
|
||||
authors = ["Joseph Henry <joseph.henry@zerotier.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
#rustc-link-search = ["../../../lib/debug/macos-x86_64/"]
|
||||
|
||||
[dependencies]
|
||||
4
examples/rust/binding-example/build.rs
Normal file
4
examples/rust/binding-example/build.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
fn main() {
|
||||
println!("cargo:rustc-flags=-l dylib=c++");
|
||||
//println!("cargo:rustc-link-search=.");
|
||||
}
|
||||
10
examples/rust/binding-example/src/main.rs
Normal file
10
examples/rust/binding-example/src/main.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
#[link(name = "libzt", kind = "dylib")]
|
||||
extern {
|
||||
fn zts_socket(address_family: i32) -> i32;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = unsafe { zts_socket(100) };
|
||||
println!("zts_socket() = {}", x);
|
||||
}
|
||||
6
examples/rust/program.c
Normal file
6
examples/rust/program.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int zts_socket(int address_family)
|
||||
{
|
||||
return -777;
|
||||
}
|
||||
1
examples/rust/program.h
Normal file
1
examples/rust/program.h
Normal file
@@ -0,0 +1 @@
|
||||
int zts_socket(int address_family);
|
||||
5
examples/rust/program.rs
Normal file
5
examples/rust/program.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
/* automatically generated by rust-bindgen 0.56.0 */
|
||||
|
||||
extern "C" {
|
||||
pub fn zts_socket(address_family: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
||||
}
|
||||
Reference in New Issue
Block a user