Skip to content

Commit 9382733

Browse files
committed
Add everything
1 parent 1d4de8d commit 9382733

File tree

3,198 files changed

+617889
-10
lines changed

Some content is hidden

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

3,198 files changed

+617889
-10
lines changed

build.gradle

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
buildscript {
3+
repositories {
4+
google()
5+
mavenCentral()
6+
}
7+
dependencies {
8+
classpath "com.android.tools.build:gradle:7.0.2"
9+
// classpath 'com.netflix.nebula:gradle-lint-plugin:latest.release' // not working gradle > 7
10+
11+
// NOTE: Do not place your application dependencies here; they belong
12+
// in the individual module build.gradle files
13+
}
14+
}
15+
16+
17+
allprojects {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
maven { url 'https://maven.google.com' }
22+
maven { url 'https://jitpack.io' }
23+
24+
}
25+
gradle.projectsEvaluated {
26+
tasks.withType(JavaCompile) {
27+
options.compilerArgs << "-Xlint:all,cast,deprecation,divzero,empty,fallthrough,finally,overrides,path,serial,unchecked"
28+
}
29+
}
30+
// plugin not working with gradle > 7
31+
// apply plugin: 'nebula.lint'
32+
// gradleLint.rules = ['all-dependency']
33+
// add as many rules here as you'd like
34+
}
35+
36+
task clean(type: Delete) {
37+
delete rootProject.buildDir
38+
}

builder/build.gradle

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,76 @@
11
plugins {
2-
id 'com.android.library'
2+
id 'com.android.application'
33
}
44

5+
//
6+
// Uncomment the blocks "externalNativeBuild" and "externalNativeBuild.cmake" for building the app
7+
// with liblsl (LSL) from the source code using CMake. Make sure you have liblsl's source code
8+
// (https://github.com/sccn/liblsl/releases/latest -> Source code) on /app-root/liblsl or the path
9+
// you specified on the block "externalNativeBuild.cmake" -> path "./liblsl-path/CMakeLists.txt"
10+
//
11+
// In case of an external CMake installation (https://cmake.org/download/ -> Binary distributions),
12+
// specify cmake.dir=path on local.properties, e.g. cmake.dir=/home/user/Android/SDK/cmake/3.18.0
13+
// Otherwise you can install CMake using Android Studio's menu via Tools -> SDK Manager -> SDK Tools
14+
// Also note that you will need CMake version >=3.12.0 to make the build. If your Gradle version is
15+
// >= 7 you will need CMake <= 3.18.0 to make it work.
16+
//
17+
// Comment these blocks for building the app using the compiled library (liblsl.so). Make sure you
18+
// copy the build library on /app-root/builder/src/main/jniLibs/
19+
// By compiling liblsl from source, CMake generates it for all Android architectures. The outcome is
20+
// stored on /app-root/builder/build/intermediates/cmake/debug/obj/
21+
// Just copy all the folders (arm64-v8a, armeabi-v7a, x86, and x86_64) on the "jniLibs" folder and
22+
// the build will succeed.
23+
//
24+
// IMPORTANT to use LSL on your code:
25+
// - Take the the last version of LSL.java:
26+
// https://github.com/labstreaminglayer/liblsl-Java/blob/master/src/edu/ucsd/sccn/LSL.java
27+
// And copy it inside your app module source code folder (don't forget your package import at the
28+
// top -> package your.package.app.name;). E.g.: /app-root/module/src/main/java/path-to-the-source/
29+
// - Ensure you include the following permission on your AndroidManifest.xml:
30+
// <uses-permission android:name="android.permission.INTERNET" />
31+
//
32+
533
android {
34+
buildToolsVersion '30.0.3'
635
compileSdk 30
736

837
defaultConfig {
938
minSdk 24
1039
targetSdk 30
1140
versionCode 1
12-
versionName "1.0"
13-
14-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
41+
versionName '1.15.0'
1542
consumerProguardFiles "consumer-rules.pro"
43+
44+
externalNativeBuild {
45+
cmake {
46+
arguments "-DANDROID_CPP_FEATURES=rtti exceptions", "-DLSL_NO_FANCY_LIBNAME=1", "-DANDROID_PLATFORM=24"
47+
targets "lsl"
48+
}
49+
}
50+
}
51+
52+
externalNativeBuild.cmake {
53+
version "3.12.0+"
54+
path "./liblsl/CMakeLists.txt"
1655
}
1756

1857
buildTypes {
1958
release {
20-
minifyEnabled false
59+
minifyEnabled true
2160
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
61+
debuggable true
2262
}
2363
}
64+
2465
compileOptions {
2566
sourceCompatibility JavaVersion.VERSION_1_8
2667
targetCompatibility JavaVersion.VERSION_1_8
2768
}
2869
}
2970

3071
dependencies {
31-
32-
implementation 'com.android.support:appcompat-v7:28.0.0'
33-
testImplementation 'junit:junit:4.+'
34-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
35-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
72+
implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
73+
implementation 'net.java.dev.jna:jna:5.9.0@aar'
74+
implementation 'com.google.android.material:material:1.4.0'
75+
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
3676
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 1.14.{build}
2+
pull_requests:
3+
do_not_increment_build_number: true
4+
shallow_clone: true
5+
environment:
6+
matrix:
7+
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1604
8+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
9+
LSLARCH: Win32
10+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
11+
LSLARCH: x64
12+
build_script:
13+
- cmd: cmake -DCMAKE_INSTALL_PREFIX=install DCMAKE_BUILD_TYPE=Release -Dlslgitrevision=%APPVEYOR_REPO_COMMIT% -Dlslgitbranch=%APPVEYOR_REPO_BRANCH% -S . -B build -T v140,host=x86 -A %LSLARCH%
14+
- sh: cmake -DCMAKE_INSTALL_PREFIX=install DCMAKE_BUILD_TYPE=Release -Dlslgitrevision=${APPVEYOR_REPO_COMMIT} -Dlslgitbranch=${APPVEYOR_REPO_BRANCH} -S . -B build
15+
- cmake -DLSL_UNITTESTS=ON -DLSL_BUILD_EXAMPLES=ON build
16+
- cmd: cmake --build build --config Release -j --target package
17+
- sh: /usr/bin/time -v cmake --build build -j 3 --target package
18+
- sh: cmake -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON build
19+
- cd build
20+
- sh: sudo dpkg -i *.deb
21+
- sh: cpack -G DEB
22+
- sh: ifconfig
23+
- cmd: testing\Release\lsl_test_internal.exe --wait-for-keypress never
24+
- cmd: set PATH=Release;%PATH% && testing\Release\lsl_test_exported.exe --wait-for-keypress never
25+
- sh: sudo route add -net 224.0.0.0 netmask 240.0.0.0 lo
26+
- sh: testing/lsl_test_internal --wait-for-keypress never
27+
- sh: testing/lsl_test_exported --wait-for-keypress never
28+
artifacts:
29+
- path: 'build/*.zip'
30+
- path: 'build/*.deb'
31+
deploy:
32+
provider: GitHub
33+
auth_token:
34+
secure: XzGnVTRjZI2AuQzR5A6qPgZViAAbBVq7/VhM7O8kyTmjIkvUjH1RrwWiFLuinsus
35+
force_update: true
36+
on:
37+
APPVEYOR_REPO_TAG: true
38+

builder/liblsl/.artifactignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*
2+
!build/*.deb
3+
!build/*.tar.bz2
4+
!build/*.dmg
5+
!build/*.7z
6+
!build/*.so
7+
!build/install/**

builder/liblsl/.clang-format

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
BasedOnStyle: LLVM
3+
ColumnLimit: 100
4+
UseTab: Always
5+
TabWidth: 4
6+
IndentWidth: 4
7+
AccessModifierOffset: -4
8+
AllowShortBlocksOnASingleLine: true
9+
AllowShortCaseLabelsOnASingleLine: true
10+
AllowShortIfStatementsOnASingleLine: true
11+
AllowShortLoopsOnASingleLine: true
12+
AlignAfterOpenBracket: false
13+
MaxEmptyLinesToKeep: 2
14+
...

builder/liblsl/.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = tab
8+
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
tags:
7+
paths_ignore: ['docs/**', '.travis.yml']
8+
pull_request:
9+
release:
10+
types: ['created']
11+
workflow_dispatch:
12+
inputs:
13+
cmakeextra:
14+
description: 'Extra CMake options'
15+
required: false
16+
default: ''
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
23+
jobs:
24+
build:
25+
name: ${{ matrix.config.name }}
26+
runs-on: ${{ matrix.config.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
config:
31+
- {name: "ubuntu-20.04", os: "ubuntu-20.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF"}
32+
- {name: "ubuntu-18.04", os: "ubuntu-latest", docker: "ubuntu:18.04" }
33+
- {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v140,host=x86"}
34+
- {name: "windows-32", os: "windows-latest", cmake_extra: "-T v140,host=x86 -A Win32"}
35+
- {name: "macOS-latest", os: "macOS-latest"}
36+
37+
# runs all steps in the container configured in config.docker or as subprocesses when empty
38+
container: ${{ matrix.config.docker }}
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: set up build environment in container
42+
run: |
43+
apt update
44+
apt install -y --no-install-recommends g++ git python3-pip ninja-build file dpkg-dev lsb-release sudo curl
45+
python3 -m pip install cmake
46+
if: ${{ matrix.config.docker }}
47+
48+
- name: Configure CMake
49+
run: |
50+
if [[ "${{ matrix.config.os }}" == "ubuntu-20.04" ]]; then
51+
sudo apt-get install libpugixml-dev
52+
fi
53+
cmake --version
54+
cmake -S . -B build \
55+
-DCMAKE_BUILD_TYPE=Release \
56+
-DCMAKE_INSTALL_PREFIX=${PWD}/install \
57+
-DLSL_UNITTESTS=ON \
58+
-DLSL_BUILD_EXAMPLES=ON \
59+
-DCPACK_PACKAGE_DIRECTORY=${PWD}/package \
60+
-Dlslgitrevision=${{ github.sha }} \
61+
-Dlslgitbranch=${{ github.ref }} \
62+
${{ matrix.config.cmake_extra }}
63+
echo ${PWD}
64+
- name: make
65+
run: cmake --build build --target install --config Release -j
66+
67+
- name: package
68+
run: |
69+
echo $GITHUB_REF
70+
cmake --build build --target package --config Release -j
71+
echo $PWD
72+
ls -la
73+
# On Debian / Ubuntu the dependencies can only be resolved for
74+
# already installed packages. Therefore, we have built all
75+
# packages without dependencies in the previous step,
76+
# install them and rebuild them with dependency discovery enabled
77+
if [[ "${{ matrix.config.os }}" == ubuntu-* ]]; then
78+
cmake -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON .
79+
sudo dpkg -i package/*.deb
80+
cmake --build build --target package --config Release -j
81+
dpkg -I package/liblsl*.deb
82+
fi
83+
cmake -E remove_directory package/_CPack_Packages
84+
- name: upload install dir
85+
uses: actions/upload-artifact@master
86+
with:
87+
name: build-${{ matrix.config.name }}
88+
path: install
89+
90+
- name: upload package
91+
uses: actions/upload-artifact@master
92+
with:
93+
name: pkg-${{ matrix.config.name }}
94+
path: package
95+
- name: print network config
96+
run: |
97+
which ifconfig && ifconfig
98+
if [ `which ip` ]; then
99+
ip link
100+
ip addr
101+
ip route
102+
ip -6 route
103+
fi
104+
105+
# run internal tests, ignore test failures on docker (missing IPv6 connectivity)
106+
- name: unit tests (internal functions)
107+
run: 'install/bin/lsl_test_internal --order rand --wait-for-keypress never --durations yes || test ! -z "${{ matrix.config.docker }}"'
108+
timeout-minutes: 5
109+
110+
- name: unit tests (exported functions)
111+
run: install/bin/lsl_test_exported --order rand --wait-for-keypress never --durations yes
112+
timeout-minutes: 5
113+
if: ${{ success() || failure() }}
114+
- name: upload to release page
115+
if: github.event_name == 'release'
116+
env:
117+
TOKEN: "token ${{ secrets.GITHUB_TOKEN }}"
118+
TAG: ${{ github.event.release.tag_name }}
119+
UPLOAD_URL: ${{ github.event.release.upload_url }}
120+
run: |
121+
# Do try this at home! The REST API is documented at
122+
# https://docs.github.com/en/free-pro-team@latest/rest and you can get a personal
123+
# access token at https://github.com/settings/tokens
124+
# (set TOKEN to "bearer abcdef1234")
125+
# you can get the UPLOAD_URL with a short bash snippet; make sure to set the env var TAG:
126+
# UPLOAD_URL=$(curl -H 'Accept: application/vnd.github.v3+json' $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/$TAG | jq -r .upload_url)
127+
UPLOAD_URL=${UPLOAD_URL%\{*} # remove "{name,label}" suffix
128+
for pkg in package/*.*; do
129+
NAME=$(basename $pkg)
130+
MIME=$(file --mime-type $pkg|cut -d ' ' -f2)
131+
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: $TOKEN" -H "Content-Type: $MIME" --data-binary @$pkg $UPLOAD_URL?name=$NAME
132+
done

builder/liblsl/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/build*/
2+
/CMakeLists.txt.user
3+
/CMakeLists.json
4+
/CMakeSettings.json
5+
/docs/liblsl_*
6+
/docs/_build
7+
/.vs/
8+
.DS_Store
9+
/out/
10+
# CLion
11+
.idea/
12+
/cmake-build-*/

builder/liblsl/.readthedocs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
sphinx:
3+
configuration: docs/conf.py
4+
# formats: all
5+
python:
6+
version: 3
7+
install:
8+
- requirements: docs/requirements.txt
9+
system_packages: true

builder/liblsl/.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: cpp
2+
env:
3+
CMakeArgs=""
4+
# https://docs.travis-ci.com/user/reference/osx/#macos-version
5+
matrix:
6+
include:
7+
- os: osx
8+
osx_image: xcode10.1
9+
env: OSXVER=MacOS10.13
10+
before_script:
11+
- brew update
12+
- brew upgrade cmake
13+
script:
14+
- cmake --version
15+
- cmake -S . -B build ${CMakeArgs} -DLSL_UNITTESTS=ON -DLSL_EXAMPLES=ON
16+
- cd build
17+
- cmake --build . --config Release -j --target install
18+
- testing/lsl_test_internal || true
19+
- testing/lsl_test_exported
20+
- cpack
21+
- cd ..
22+
deploy:
23+
provider: releases
24+
skip_cleanup: true
25+
api_key:
26+
secure: MAin7yY6lRQNC7gLeE/aDGA90a2TZPjAwQGofyuGvih5T0p3OdKxFn64/lFzEWqb3x74MEu6I4AMteL/wjkminlHGn8fd1bSLtp+2TvnKFnaCuxuhlCNX4BmP741MHEmNMTo8qA+StuxDxwfHh8KVjuFxOkiLV9FolSpxZ3jhl8mBi3IMDodilyfsCniAw/WzekfATkJwmhQ9co642rkTwBKZ7goxdXJmewjEjBsiFn2SUT2+MCcy7NltjYvPdSrUH1LyhVKcSJch7lXqFnlGI21mJxlYdOhd9rA6wOYRZ1hzBRpqAWzE8kbDapMMOfLWrLQP+t5U3WZrt5e7Na/iuopYgzofgfzGr4xK0NwHUuHpc8C1Fair3nOke8IGNDraVHcZazEsBwxv5ekCUTOUFr5lka+ukcznP7PDw2ksIbpOR7bb9G2ubkQT4bDzIfMMOJSPzUbeTN+ds6xiVXukndMsXVW1rkZXk7O4uA60hGWBpX8okddask81Fk6jIBXdJomiRySDfd1DvP16vDGOfei2GZFX8iSvvATQIEE8CCL750vgUuEPPeRvyug2m6+CerAjvH73fmtGiKDmeaQNz+eBnbBpMphKCUvKRpSjSsBPNsQH/epPo34JnUczfzVbZGNNv87OeHDz7POe5YY6+PSwJbfIusPTMY6VdI/g9U=
27+
file: build/*.tar.*
28+
file_glob: true
29+
on:
30+
repo: sccn/liblsl
31+
tags: true

0 commit comments

Comments
 (0)