Skip to content

Commit 36aff0f

Browse files
committed
reformat astyle source
1 parent 50669d4 commit 36aff0f

File tree

15 files changed

+12256
-13191
lines changed

15 files changed

+12256
-13191
lines changed

.idea/modules.xml

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

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ dependencies {
136136
api project(':emulatorview')
137137
api project(':libtermexec')
138138
api project(':style')
139+
api project(':astyle')
139140

140141
implementation 'com.google.firebase:firebase-core:15.0.2'
141142
implementation 'com.google.firebase:firebase-storage:15.0.2'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import android.support.test.runner.AndroidJUnit4;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
6+
@RunWith(AndroidJUnit4.class)
7+
public class AStyleInterfaceTest {
8+
9+
@Test
10+
public void testCpp() {
11+
String format = AStyleInterface.format("", "");
12+
}
13+
}

astyle/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ android {
3131
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3232
}
3333
}
34+
35+
externalNativeBuild {
36+
ndkBuild {
37+
path 'src/main/jni/Android.mk'
38+
}
39+
}
3440
}
3541
dependencies {
3642
testImplementation 'junit:junit:4.12'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* AStyleInterface
3+
*/
4+
public class AStyleInterface {
5+
6+
public static String format(String code, String opts) {
7+
return AStyleMain(code, opts);
8+
}
9+
10+
public static native String AStyleMain(String text, String opts);
11+
}

astyle/src/main/jni/Android.mk

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ LOCAL_PATH:= $(call my-dir)
33
include $(CLEAR_VARS)
44
LOCAL_MODULE := astyle
55

6-
LOCAL_SRC_FILES := /src/ASBeautifier.cpp \
7-
/src/ASEnhancer.cpp \
8-
/src/ASFormatter.cpp \
9-
/src/ASLocalizer.cpp \
10-
/src/ASResource.cpp \
11-
/src/astyle_main.cpp
12-
13-
LOCAL_LDLIBS := -llog
14-
LOCAL_CXX_FLAGS+=-std=c++11
6+
LOCAL_SRC_FILES := src/ASBeautifier.cpp \
7+
src/ASEnhancer.cpp \
8+
src/ASFormatter.cpp \
9+
src/ASLocalizer.cpp \
10+
src/ASResource.cpp \
11+
src/astyle_main.cpp
1512

1613
include $(BUILD_SHARED_LIBRARY)

astyle/src/main/jni/Application.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APP_PLATFORM := android-14
2+
APP_ABI := armeabi-v7a x86
3+
APP_STL := gnustl_static

0 commit comments

Comments
 (0)