Skip to content

Commit af2ba89

Browse files
committed
refactor code
1 parent 9ce733f commit af2ba89

File tree

4,741 files changed

+462
-529
lines changed

Some content is hidden

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

4,741 files changed

+462
-529
lines changed

.idea/misc.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/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<uses-permission android:name="com.android.vending.BILLING" />
88

99
<application
10-
android:name="com.duy.editor.TextEditorApplication"
10+
android:name="com.duy.CppIdeApplication"
1111
android:allowBackup="true"
1212
android:fullBackupContent="true"
1313
android:icon="@mipmap/ic_launcher"

app/src/main/java/com/duy/ccppcompiler/compiler/compilers/GCCCompiler.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ protected String buildCommand(File[] sourceFiles) {
8282
File source = sourceFiles[0];
8383
String fileName = source.getName();
8484

85-
File buildDir = new File(source.getParent(), "build");
86-
buildDir.mkdir();
87-
mOutFile = new File(buildDir, fileName.substring(0, fileName.lastIndexOf(".")));
85+
mOutFile = new File(getBuildDir(source), fileName.substring(0, fileName.lastIndexOf(".")));
8886

8987
CommandBuilder builder = new CommandBuilder(COMPILER_NAME);
9088
for (File sourceFile : sourceFiles) {
@@ -123,4 +121,10 @@ protected String buildCommand(File[] sourceFiles) {
123121

124122
return builder.buildCommand();
125123
}
124+
125+
protected String getBuildDir(File source) {
126+
File buildDir = new File(source.getParent(), "build");
127+
buildDir.mkdir();
128+
return buildDir.getAbsolutePath();
129+
}
126130
}

app/src/main/java/com/duy/ccppcompiler/compiler/compilers/GPlusPlusCompiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public GccCommandResult compile(File[] sourceFiles) {
4545
protected String buildCommand(File[] sourceFiles) {
4646
File file = sourceFiles[0];
4747
String fileName = file.getName();
48-
mOutFile = new File(file.getParent(), fileName.substring(0, fileName.lastIndexOf(".")));
48+
mOutFile = new File(getBuildDir(file), fileName.substring(0, fileName.lastIndexOf(".")));
4949

5050
CommandBuilder builder = new CommandBuilder(COMPILER_NAME);
5151
for (File sourceFile : sourceFiles) {

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

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

sdlplugin/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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-
package="com.duy.c.cpp.compiler.sdlplugin"
4+
package="com.duy.ccppcompiler.sdlplugin"
55
android:installLocation="auto">
66

77
<uses-permission android:name="android.permission.INTERNET" />
@@ -17,7 +17,7 @@
1717
tools:ignore="GoogleAppIndexingWarning">
1818

1919
<activity
20-
android:name="com.duy.c.cpp.compiler.sdlplugin.sdlpluginActivity"
20+
android:name=".sdlpluginActivity"
2121
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
2222
android:label="@string/app_name">
2323

sdlplugin/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ android {
3636
sourceSets {
3737
main {
3838
manifest.srcFile 'AndroidManifest.xml'
39-
res.srcDir 'res'
4039
assets.srcDir 'assets'
41-
jni.srcDir 'jni'
42-
java.srcDir 'java'
4340
}
4441
}
4542
buildTypes {
@@ -57,7 +54,7 @@ android {
5754

5855
externalNativeBuild {
5956
ndkBuild {
60-
path 'jni/Android.mk'
57+
path 'src/main/jni/Android.mk'
6158
}
6259
}
6360
}

sdlplugin/java/com/duy/c/cpp/compiler/sdlplugin/Utils.java

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

sdlplugin/jni/utils/utils.h

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

0 commit comments

Comments
 (0)