Skip to content

Commit 94e5de2

Browse files
authored
Merge pull request TUWien#28 from matejbart/feat-as-4.1.2-update
updates project to latest AGP v4.1.2
2 parents 37e4a5f + cd6499c commit 94e5de2

File tree

10 files changed

+278
-284
lines changed

10 files changed

+278
-284
lines changed

.gitignore

Lines changed: 97 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,100 @@
1-
# Compiled Object files
2-
*.slo
3-
*.lo
4-
*.o
5-
*.obj
6-
*.o.d
7-
8-
# Precompiled Headers
9-
*.gch
10-
*.pch
11-
12-
# Compiled Dynamic libraries
13-
*.so
14-
*.dylib
15-
*.dll
16-
17-
# Fortran module files
18-
*.mod
19-
*.smod
20-
21-
# Compiled Static libraries
22-
*.lai
23-
*.la
24-
*.a
25-
*.lib
26-
27-
# Executables
28-
*.exe
29-
*.out
30-
*.app
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/android
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=android
4+
5+
### Android ###
6+
# Built application files
317
*.apk
8+
*.aar
9+
*.ap_
10+
*.aab
3211

33-
# Android
34-
*.iml
35-
*.gradle
36-
/gradle.properties
37-
/local.properties
38-
/.idea/workspace.xml
39-
/.idea/libraries
40-
.DS_Store
41-
/build
42-
/captures
43-
Android.mk
44-
/.idea/*
45-
app/build
46-
openCVLibrary310
47-
import-summary.txt
48-
camera_view.xml
49-
/api_info.txt
50-
app/.externalNativeBuild/*
51-
52-
53-
# msvc
54-
build2015*
55-
CMakeUser.cmake
56-
testimg.jpg
57-
/testimg-syn.jpg
58-
/testimg-syn-g.jpg
59-
/testimg-syn-g-r.jpg
60-
/testimg-orig.jpg
61-
/testimg-g.jpg
62-
/test.png
63-
/result.tif
12+
# Files for the ART/Dalvik VM
13+
*.dex
14+
15+
# Java class files
16+
*.class
17+
18+
# Generated files
6419
bin/
65-
img/
66-
api_info.txt
67-
/app/.externalNativeBuild
68-
/app/src/main/java/at/ac/tuwien/caa/docscan/camera/MediaSaver.java
69-
/app/src/main/java/at/ac/tuwien/caa/docscan/camera/Storage.java
70-
/projectFilesBackup/.idea/workspace.xml
71-
/app/src/main/java/at/ac/tuwien/caa/docscan/camera/Util.java
72-
/app/src/main/res/drawable/ic_photo_album_black_24dp.xml
73-
/app/src/main/res/layout/test_activity.xml
74-
/app/src/main/res/drawable/cat.png
75-
/app/src/main/res/drawable/puppy.png
76-
/openCVLibrary/*
77-
/app/release
78-
/app/CMakeLists.txt
79-
/app/src/main/jniLibs
80-
/app/src/main/include
20+
gen/
21+
out/
22+
# Uncomment the following line in case you need and you don't have the release build type files in your app
23+
# release/
24+
25+
# Gradle files
26+
.gradle/
27+
build/
28+
29+
# Local configuration file (sdk path, etc)
30+
local.properties
31+
32+
# Proguard folder generated by Eclipse
33+
proguard/
34+
35+
# Log Files
36+
*.log
37+
38+
# Android Studio Navigation editor temp files
39+
.navigation/
40+
41+
# Android Studio captures folder
42+
captures/
43+
44+
# IntelliJ
45+
*.iml
46+
.idea/workspace.xml
47+
.idea/tasks.xml
48+
.idea/gradle.xml
49+
.idea/assetWizardSettings.xml
50+
.idea/dictionaries
51+
.idea/libraries
52+
# Android Studio 3 in .gitignore file.
53+
.idea/caches
54+
.idea/modules.xml
55+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
56+
.idea/navEditor.xml
57+
.idea/*
58+
59+
# Keystore files
60+
# Uncomment the following lines if you do not want to check your keystore files in.
61+
#*.jks
62+
#*.keystore
63+
64+
# External native build folder generated in Android Studio 2.2 and later
65+
.externalNativeBuild
66+
.cxx/
67+
68+
# Google Services (e.g. APIs or Firebase)
69+
# google-services.json
70+
71+
# Freeline
72+
freeline.py
73+
freeline/
74+
freeline_project_description.json
75+
76+
# fastlane
77+
fastlane/report.xml
78+
fastlane/Preview.html
79+
fastlane/screenshots
80+
fastlane/test_output
81+
fastlane/readme.md
82+
83+
# Version control
84+
vcs.xml
85+
86+
# lint
87+
lint/intermediates/
88+
lint/generated/
89+
lint/outputs/
90+
lint/tmp/
91+
# lint/reports/
92+
93+
### Android Patch ###
94+
gen-external-apklibs
95+
output.json
96+
97+
# Replacement of .externalNativeBuild directories introduced
98+
# with Android Studio 3.5.
99+
100+
# End of https://www.toptal.com/developers/gitignore/api/android

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "opencv_libs"]
2+
path = opencv_libs
3+
url = git@github.com:hollaus/opencv_libs.git

.travis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ before_install:
3939
- chmod +x gradle/wrapper/gradle-wrapper.jar
4040
- chmod +x gradlew
4141
before_script:
42-
# - ls -lh
43-
# - git clone https://github.com/hollaus/opencv_libs.git OpenCV-android-sdk
44-
- ls -lh
45-
- git clone https://github.com/hollaus/opencv_libs.git opencv_libs
46-
- cd app/src/main
47-
- ln -s ../../../opencv_libs/sdk/native/libs jniLibs
48-
- ln -s ../../../opencv_libs/sdk/native/jni/include include
49-
- cd ../../..
5042
# unfortunately we do not have abi for android-27. Tested images can be found here:
5143
# https://stackoverflow.com/questions/45100298/how-to-setup-an-emulator-running-api-25-using-a-build-matrix-on-travis-ci
5244
# TODO: test other images as well

README.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,10 @@ Fabian Hollaus,
88
Florian Kleber,
99
Markus Diem
1010

11-
## Build Instructions
12-
DocScan makes use of native (C++) OpenCV and OpenCV Java API. The Java part is automatically downloaded after syncing.
13-
### Download native library
14-
For the native part you have to clone this repo:
15-
16-
```shell
17-
git clone https://github.com/hollaus/opencv_libs.git opencv_native
18-
```
19-
### Add native library to the project
20-
Next you have to copy two folders from the native library to the project.
21-
- copy `opencv_native/sdk/native/libs` to `app/src/main/jniLibs`
22-
- copy `opencv_native/sdk/native/jni/include` to `app/src/main/include`
23-
24-
Alternatively, you can create symlinks - as written below. It is assumed that your project root folder (DocScan) and the opencv_native folder are on the same hierarchy level.
25-
26-
Windows:
27-
28-
```shell
29-
cd app/src/main
30-
mklink /d jniLibs ..\..\..\..\opencv_native\sdk\native\libs
31-
mklink /d include ..\..\..\..\opencv_native\sdk\native\jni\include
32-
```
33-
34-
Linux:
35-
```shell
36-
cd app/src/main
37-
ln -s ../../../opencv_native/sdk/native/libs jniLibs
38-
ln -s ../../../opencv_native/sdk/native/jni/include include
39-
```
40-
11+
### Build Instructions
12+
DocScan makes use of native (C++) OpenCV and OpenCV Java API. The Java part is automatically downloaded after syncing,
13+
the native part is imported as a git submodule from `https://github.com/hollaus/opencv_libs.git` which also automatically
14+
downloads the resources.
4115

4216
### Sync and build the project
4317

app/CMakeLists.txt

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,32 @@
55

66
cmake_minimum_required(VERSION 3.4.1)
77

8-
# The includes and executables can be found in https://github.com/hollaus/opencv_native
9-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/main/include/)
8+
# The includes and executables can be found in https://github.com/hollaus/opencv_native which are
9+
# imported as a git submodule
10+
include_directories(${PATH_TO_OPENCV_NATIVE}/jni/include/)
1011

11-
add_library( lib_opencv SHARED IMPORTED )
12-
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java3.so)
12+
add_library(lib_opencv SHARED IMPORTED)
13+
set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${PATH_TO_OPENCV_NATIVE}/libs/${ANDROID_ABI}/libopencv_java3.so)
1314

1415
# Creates and names a library, sets it as either STATIC
1516
# or SHARED, and provides the relative paths to its source code.
1617
# You can define multiple libraries, and CMake builds them for you.
1718
# Gradle automatically packages shared libraries with your APK.
1819

1920
add_library( # Sets the name of the library.
20-
docscan-native
21+
docscan-native
2122

22-
# Sets the library as a shared library.
23-
SHARED
23+
# Sets the library as a shared library.
24+
SHARED
2425

25-
# Provides a relative path to your source file(s).
26-
src/main/cpp/DocScanInterface.cpp
27-
src/main/cpp/FocusMeasure.cpp
28-
src/main/cpp/DkMath.cpp
29-
src/main/cpp/PageSegmentationUtils.cpp
30-
src/main/cpp/PageSegmentation.cpp
31-
src/main/cpp/Utils.cpp
32-
src/main/cpp/Illumination.cpp )
26+
# Provides a relative path to your source file(s).
27+
src/main/cpp/DocScanInterface.cpp
28+
src/main/cpp/FocusMeasure.cpp
29+
src/main/cpp/DkMath.cpp
30+
src/main/cpp/PageSegmentationUtils.cpp
31+
src/main/cpp/PageSegmentation.cpp
32+
src/main/cpp/Utils.cpp
33+
src/main/cpp/Illumination.cpp)
3334

3435
# Searches for a specified prebuilt library and stores the path as a
3536
# variable. Because CMake includes system libraries in the search path by
@@ -38,19 +39,19 @@ add_library( # Sets the name of the library.
3839
# completing its build.
3940

4041
find_library( # Sets the name of the path variable.
41-
log-lib
42+
log-lib
4243

43-
# Specifies the name of the NDK library that
44-
# you want CMake to locate.
45-
log )
44+
# Specifies the name of the NDK library that
45+
# you want CMake to locate.
46+
log)
4647

4748
# Specifies libraries CMake should link to your target library. You
4849
# can link multiple libraries, such as libraries you define in this
4950
# build script, prebuilt third-party libraries, or system libraries.
5051

5152
target_link_libraries( # Specifies the target library.
52-
docscan-native
53-
lib_opencv
54-
# Links the target library to the log library
55-
# included in the NDK.
56-
${log-lib} )
53+
docscan-native
54+
lib_opencv
55+
# Links the target library to the log library
56+
# included in the NDK.
57+
${log-lib})

0 commit comments

Comments
 (0)