mirror of
https://github.com/adaptech-cz/Tesseract4Android.git
synced 2026-01-09 06:12:45 +08:00
Create leptonica module
This commit is contained in:
parent
7159767364
commit
34f623c340
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -10,6 +10,7 @@
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/leptonica" />
|
||||
<option value="$PROJECT_DIR$/sample" />
|
||||
<option value="$PROJECT_DIR$/tesseract4android" />
|
||||
</set>
|
||||
|
||||
1
leptonica/.gitignore
vendored
Normal file
1
leptonica/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
46
leptonica/build.gradle
Normal file
46
leptonica/build.gradle
Normal file
@ -0,0 +1,46 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'cz.adaptech.thirdparty.leptonica'
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
minSdk 16
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
cppFlags ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('src/main/cpp/CMakeLists.txt')
|
||||
version '3.22.1'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
}
|
||||
0
leptonica/consumer-rules.pro
Normal file
0
leptonica/consumer-rules.pro
Normal file
21
leptonica/proguard-rules.pro
vendored
Normal file
21
leptonica/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
26
leptonica/src/androidTest/java/cz/adaptech/thirdparty/leptonica/ExampleInstrumentedTest.java
vendored
Normal file
26
leptonica/src/androidTest/java/cz/adaptech/thirdparty/leptonica/ExampleInstrumentedTest.java
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
package cz.adaptech.thirdparty.leptonica;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("cz.adaptech.thirdparty.leptonica.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
4
leptonica/src/main/AndroidManifest.xml
Normal file
4
leptonica/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
17
leptonica/src/test/java/cz/adaptech/thirdparty/leptonica/ExampleUnitTest.java
vendored
Normal file
17
leptonica/src/test/java/cz/adaptech/thirdparty/leptonica/ExampleUnitTest.java
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
package cz.adaptech.thirdparty.leptonica;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@ -2,3 +2,4 @@ include ':tesseract4android'
|
||||
if (!System.env.JITPACK) {
|
||||
include ':sample'
|
||||
}
|
||||
include ':leptonica'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user