Skip to content

Commit 1f5aa73

Browse files
committed
make a library
1 parent edc9f24 commit 1f5aa73

30 files changed

+436
-386
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
app/src/main/jniLibs/*/*.so

.idea/gradle.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+59-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
plugins {
2-
id 'com.android.application'
2+
id 'com.android.library'
3+
id 'maven-publish'
4+
id 'signing'
35
}
46

57
android {
6-
namespace 'com.example.cozoandroid'
7-
compileSdk 32
8+
namespace 'org.cozodb'
9+
compileSdk 33
810

911
defaultConfig {
10-
applicationId "com.example.cozoandroid"
1112
minSdk 16
12-
targetSdk 32
13+
targetSdk 33
1314
versionCode 1
1415
versionName "1.0"
15-
16-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1716
}
1817

1918
buildTypes {
@@ -28,12 +27,58 @@ android {
2827
}
2928
}
3029

31-
dependencies {
3230

33-
implementation 'androidx.appcompat:appcompat:1.5.1'
34-
implementation 'com.google.android.material:material:1.7.0'
35-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
36-
testImplementation 'junit:junit:4.13.2'
37-
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
38-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
31+
publishing {
32+
publications {
33+
mavenJava(MavenPublication) {
34+
groupId = 'io.github.cozodb'
35+
artifactId = 'cozo_android'
36+
version = '0.2.1'
37+
38+
pom {
39+
name = 'cozo_android'
40+
description = 'Android wrapper for CozoDB'
41+
url = 'https://github.com/cozodb/cozo-lib-android'
42+
inceptionYear = '2022'
43+
44+
licenses {
45+
license {
46+
name = 'MIT License'
47+
url = 'https://opensource.org/licenses/MIT'
48+
}
49+
}
50+
developers {
51+
developer {
52+
id = 'zh217'
53+
name = 'Ziyang Hu'
54+
55+
}
56+
}
57+
scm {
58+
connection = 'scm:git:git:github.com/cozodb/cozo-lib-android.git'
59+
developerConnection = 'scm:git:https://github.com/cozodb/cozo-lib-android.git'
60+
url = 'https://github.com/cozodb/cozo-lib-android.git'
61+
}
62+
}
63+
}
64+
}
65+
66+
repositories {
67+
maven {
68+
name = "OSSRH"
69+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
70+
credentials {
71+
username = findProperty('ossrhUsername')
72+
password = findProperty('ossrhPassword')
73+
}
74+
}
75+
}
76+
}
77+
78+
signing {
79+
sign publishing.publications.mavenJava
80+
}
81+
82+
dependencies {
83+
implementation 'org.sharegov:mjson:1.4.1'
3984
}

app/src/main/AndroidManifest.xml

+3-25
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
4-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
5-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
64

7-
<application
8-
android:allowBackup="true"
9-
android:dataExtractionRules="@xml/data_extraction_rules"
10-
android:fullBackupContent="@xml/backup_rules"
11-
android:icon="@mipmap/ic_launcher"
12-
android:label="@string/app_name"
13-
android:roundIcon="@mipmap/ic_launcher_round"
14-
android:supportsRtl="true"
15-
android:theme="@style/Theme.CozoAndroid"
16-
tools:targetApi="31">
17-
<activity
18-
android:name=".MainActivity"
19-
android:exported="true">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
5+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
227

23-
<category android:name="android.intent.category.LAUNCHER" />
24-
</intent-filter>
25-
26-
<meta-data
27-
android:name="android.app.lib_name"
28-
android:value="" />
29-
</activity>
30-
</application>
8+
<application />
319
</manifest>

app/src/main/java/com/example/cozoandroid/MainActivity.java

-38
This file was deleted.

0 commit comments

Comments
 (0)