Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 531ed21

Browse files
committed
Publish to Maven Central
1 parent 03efe06 commit 531ed21

File tree

6 files changed

+63
-10
lines changed

6 files changed

+63
-10
lines changed

.idea/deploymentTargetDropDown.xml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Serenade Labs, Inc.
3+
Copyright (c) 2021 Akash Yadav
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

android-tree-sitter/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
import com.vanniktech.maven.publish.*
2+
13
plugins {
24
id 'com.android.library'
5+
id 'com.vanniktech.maven.publish' version '0.21.0'
36
}
47

58
android {
69
namespace 'com.itsaky.androidide.treesitter'
7-
ndkVersion "24.0.8215888"
810
compileSdk 33
911

1012
defaultConfig {
1113
minSdk 21
1214
targetSdk 33
15+
16+
versionCode 100
17+
versionName "1.0.0"
1318
}
1419

1520
buildTypes {
@@ -29,6 +34,16 @@ dependencies {
2934
testImplementation 'junit:junit:4.13.2'
3035
}
3136

37+
publishing {
38+
repositories {
39+
maven {
40+
def releasesRepoUrl = "$buildDir/repos/releases"
41+
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
42+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
43+
}
44+
}
45+
}
46+
3247
final def archs = ["aarch64", "arm", "x86", "x86_64"]
3348
def ndkDir = System.getenv("ANDROID_NDK_HOME")
3449
def javaHome = System.getenv("JAVA_HOME")

app/src/main/java/com/itsaky/androidide/androidtreesitter/MainActivity.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
public class MainActivity extends AppCompatActivity {
2626

2727
static {
28-
Log.d("MainActivity", "Loading library...");
2928
System.loadLibrary("ts");
3029
}
3130

@@ -35,9 +34,7 @@ public class MainActivity extends AppCompatActivity {
3534

3635
@Override
3736
public void onCreate(@Nullable Bundle savedInstanceState) {
38-
Log.d("MainActivity", "pre onCreate()");
3937
super.onCreate(savedInstanceState);
40-
Log.d("MainActivity", "onCreate()");
4138
binding = ActivityMainBinding.inflate(getLayoutInflater());
4239
content = binding.content;
4340

@@ -83,9 +80,9 @@ private void appendTo(@NonNull StringBuilder sb, @NonNull TSTreeCursor cursor, i
8380
sb.append("\n");
8481
repeatSpaces(sb, indentLevel * 2);
8582

86-
if (node.getChildCount() != 0) {
87-
for (int i = 0; i < node.getChildCount(); i++) {
88-
final var child = node.getChild(i);
83+
if (node.getNamedChildCount() != 0) {
84+
for (int i = 0; i < node.getNamedChildCount(); i++) {
85+
final var child = node.getNamedChild(i);
8986
appendTo(sb, child.walk(), indentLevel + 1);
9087
}
9188
}

gradle.properties

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
android.nonTransitiveRClass=true
22
android.useAndroidX=true
33
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
4+
5+
SONATYPE_HOST=S01
6+
RELEASE_SIGNING_ENABLED=true
7+
8+
GROUP=io.github.itsaky
9+
POM_ARTIFACT_ID=android-tree-sitter
10+
VERSION_NAME=1.0.0
11+
12+
POM_NAME=Android Tree Sitter
13+
POM_DESCRIPTION=Android Java bindings for tree-sitter.
14+
POM_INCEPTION_YEAR=2020
15+
POM_URL=https://github.com/itsaky/android-tree-sitter/
16+
17+
POM_LICENSE_NAME=The MIT License
18+
POM_LICENSE_URL=https://github.com/itsaky/android-tree-sitter/blob/main/LICENSE
19+
POM_LICENSE_DIST=repo
20+
21+
POM_SCM_URL=https://github.com/itsaky/android-tree-sitter/
22+
POM_SCM_CONNECTION=scm:git:git://github.com/itsaky/android-tree-sitter.git
23+
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/itsaky/android-tree-sitter.git
24+
25+
POM_DEVELOPER_ID=itsaky
26+
POM_DEVELOPER_NAME=Akash Yadav
27+
POM_DEVELOPER_URL=https://github.com/itsaky

lib/ts.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,4 +413,4 @@ JNIEXPORT jlong JNICALL Java_com_itsaky_androidide_treesitter_TreeSitter_tsQuery
413413
TSQueryError* error_type = new TSQueryError;
414414
TSQuery* query = ts_query_new((TSLanguage*) language, c_source, source_length, error_offset, error_type);
415415
return (jlong) query;
416-
}
416+
}

0 commit comments

Comments
 (0)