Skip to content

Commit d57a107

Browse files
committed
Compile success astyle module
1 parent 36aff0f commit d57a107

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3415
-3711
lines changed

.idea/modules.xml

Lines changed: 1 addition & 1 deletion
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ dependencies {
136136
api project(':emulatorview')
137137
api project(':libtermexec')
138138
api project(':style')
139-
api project(':astyle')
139+
api project(':libastyle')
140140

141141
implementation 'com.google.firebase:firebase-core:15.0.2'
142142
implementation 'com.google.firebase:firebase-storage:15.0.2'

app/src/androidTest/java/AStyleInterfaceTest.java

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.duy.astyle;
2+
3+
import android.support.test.runner.AndroidJUnit4;
4+
5+
import org.junit.Test;
6+
import org.junit.runner.RunWith;
7+
8+
@RunWith(AndroidJUnit4.class)
9+
public class AStyleInterfaceTest {
10+
11+
@Test
12+
public void testCpp() {
13+
String code = "int Foo(bool isBar){if (isBar) { bar(); return 1; }else return 0;}";
14+
String format = AStyleInterface.format(code, "--style=allman");
15+
System.out.println("format = " + format);
16+
}
17+
}

app/src/main/java/com/duy/editor/CodeEditorActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.view.SubMenu;
2525
import android.widget.Toast;
2626

27+
import com.duy.astyle.AStyleInterface;
2728
import com.duy.ccppcompiler.BuildConfig;
2829
import com.duy.ccppcompiler.R;
2930
import com.duy.ccppcompiler.compiler.CompileManager;
@@ -67,9 +68,13 @@ public class CodeEditorActivity extends SimpleEditorActivity {
6768
protected void onCreate(Bundle savedInstanceState) {
6869
super.onCreate(savedInstanceState);
6970
mPremiumHelper = new InAppPurchaseHelper(this);
70-
7171
// Monitor launch times and interval from installation
7272
RateThisApp.onCreate(this);
73+
74+
String code = "int Foo(bool isBar){if (isBar) { bar(); return 1; }else return 0;}";
75+
AStyleInterface aStyleInterface = new AStyleInterface();
76+
String format = aStyleInterface.format(code, "--style=allman");
77+
System.out.println("format = " + format);
7378
}
7479

7580
@Override

astyle/src/main/java/AStyleInterface.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)