Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
1d8704b
feat: convert files to kotlin
PranavPurwar Apr 15, 2022
93bd65c
fix errors
PranavPurwar Apr 15, 2022
1ddb4b6
fix errors
PranavPurwar Apr 15, 2022
d776776
fix: add class
PranavPurwar Apr 15, 2022
4a32530
fix
PranavPurwar Apr 15, 2022
0e5287f
add pseudo init method
PranavPurwar Apr 15, 2022
82fabdd
fix code
PranavPurwar Apr 15, 2022
af04b56
fix code
PranavPurwar Apr 16, 2022
394414c
up
PranavPurwar Apr 16, 2022
1eb8bc2
you
PranavPurwar Apr 16, 2022
80e30ab
make class a singleton
PranavPurwar Apr 16, 2022
4002766
hi
PranavPurwar Apr 16, 2022
d39c405
up
PranavPurwar Apr 16, 2022
0bcc588
you
PranavPurwar Apr 16, 2022
a3b3b0c
give
PranavPurwar Apr 16, 2022
12a11dc
gonna
PranavPurwar Apr 16, 2022
1a5a1f0
never
PranavPurwar Apr 16, 2022
519c823
set same jvm target
PranavPurwar Apr 17, 2022
7af5756
add toString()
PranavPurwar Apr 17, 2022
4771d70
use string
PranavPurwar Apr 17, 2022
659e381
options
PranavPurwar Apr 17, 2022
9c820c4
set jvm version to 1.8
PranavPurwar Apr 17, 2022
8262918
jvm
PranavPurwar Apr 17, 2022
f49dcba
toKotlin()
PranavPurwar Apr 17, 2022
a1189ed
fixErrors()
PranavPurwar Apr 17, 2022
95d4f9c
fix
PranavPurwar Apr 17, 2022
a58bb54
removeColons()
PranavPurwar Apr 17, 2022
252e0ab
fix()
PranavPurwar Apr 17, 2022
b655d39
resolveOverloadAmbigiouty()
PranavPurwar Apr 17, 2022
562eaf9
fixMethods()
PranavPurwar Apr 17, 2022
d1b702a
Constructor()
PranavPurwar Apr 17, 2022
32fa8bb
variables automatically get compiled to get and set methods
PranavPurwar Apr 17, 2022
0b02952
get
PranavPurwar Apr 17, 2022
2f4c73f
add annotation
PranavPurwar Apr 17, 2022
0df9e4c
add workflow
PranavPurwar Apr 17, 2022
7ad8710
fix
PranavPurwar Apr 17, 2022
4326fb7
z
PranavPurwar Apr 17, 2022
aa8500c
fix code
PranavPurwar Apr 17, 2022
fd981dc
y
PranavPurwar Apr 17, 2022
9dae0c5
x
PranavPurwar Apr 17, 2022
9ab6098
w
PranavPurwar Apr 17, 2022
d25164a
v
PranavPurwar Apr 17, 2022
a2af1c1
companion
PranavPurwar Apr 17, 2022
21037a2
fix code
PranavPurwar Apr 17, 2022
98704ae
close streams after use
PranavPurwar Apr 17, 2022
8839177
fix
PranavPurwar Apr 17, 2022
8059173
clear
PranavPurwar Apr 17, 2022
f386597
continue
PranavPurwar Apr 17, 2022
864f959
loop
PranavPurwar Apr 17, 2022
5510d94
label
PranavPurwar Apr 17, 2022
eaadaad
make method static
PranavPurwar Apr 17, 2022
0648724
fix
PranavPurwar Apr 17, 2022
a30abfd
fix indent
PranavPurwar Apr 17, 2022
489e9df
inline variable
PranavPurwar Apr 17, 2022
7264769
add null check
PranavPurwar Apr 18, 2022
94f1e8a
fix code
PranavPurwar Apr 18, 2022
5cd2360
commit
PranavPurwar Apr 18, 2022
73103cf
fix
PranavPurwar Apr 18, 2022
99a04ac
set entry to null
PranavPurwar Apr 18, 2022
fb376a7
make variable nullable
PranavPurwar Apr 18, 2022
9258065
kotlin
PranavPurwar Apr 18, 2022
1a0986e
make class abstract
PranavPurwar Apr 18, 2022
9efe9ed
fix err
PranavPurwar Apr 18, 2022
2feda3c
object
PranavPurwar Apr 18, 2022
303e831
cast variable
PranavPurwar Apr 18, 2022
21178c1
commit
PranavPurwar Apr 18, 2022
9ee18eb
remove lateinit
PranavPurwar Apr 18, 2022
6cd2f77
Any
PranavPurwar Apr 18, 2022
98b1e77
sus
PranavPurwar Apr 18, 2022
c2493fa
length
PranavPurwar Apr 18, 2022
a7b4a2c
kotlin
PranavPurwar Apr 18, 2022
4fe8509
use typed array
PranavPurwar Apr 18, 2022
e8abbc8
gg
PranavPurwar Apr 18, 2022
696f108
check if variable is null
PranavPurwar Apr 18, 2022
8102743
kotlin
PranavPurwar Apr 18, 2022
87e6ee3
gg
PranavPurwar Apr 18, 2022
5bf3b2e
add throws annotation for java interoperability
PranavPurwar Apr 18, 2022
7ecea57
use length method
PranavPurwar Apr 18, 2022
1da2c5d
fix errors
PranavPurwar Apr 18, 2022
250736c
make var nullable
PranavPurwar Apr 18, 2022
8699904
use safe call
PranavPurwar Apr 18, 2022
6df7a32
cleanup files
PranavPurwar Apr 18, 2022
08147d1
fix: remove duplicate files
PranavPurwar Apr 18, 2022
daeab02
fix code
PranavPurwar Apr 18, 2022
f310be8
add annotation
PranavPurwar Apr 18, 2022
3e08e6f
revert to previous implementation
PranavPurwar Apr 18, 2022
54fae1f
remove var keyword
PranavPurwar Apr 18, 2022
e13d92e
add if statement
PranavPurwar Apr 18, 2022
20f4f34
?
PranavPurwar Apr 18, 2022
542dd0c
fix
PranavPurwar Apr 18, 2022
fad9735
hh
PranavPurwar Apr 18, 2022
d359f4f
lmao
PranavPurwar Apr 18, 2022
0b83720
don't thow exception explicitly
PranavPurwar Apr 18, 2022
01b221c
catch throwable
PranavPurwar Apr 18, 2022
3f85ccb
return list
PranavPurwar Apr 18, 2022
cae2c31
set list type
PranavPurwar Apr 18, 2022
5b21399
list
PranavPurwar Apr 18, 2022
346543f
return list element
PranavPurwar Apr 18, 2022
465797b
fix
PranavPurwar Apr 18, 2022
4e03746
fix: add class files to list
PranavPurwar Apr 18, 2022
26af9d7
check if method is void
PranavPurwar Apr 18, 2022
5a71bfd
escape kotlin keywords
PranavPurwar Apr 18, 2022
1972cde
simplify method
PranavPurwar Apr 18, 2022
82ffd59
remove safe call from overriden method
PranavPurwar Apr 18, 2022
249b783
use built in kotlin function to convert int to char
PranavPurwar Apr 18, 2022
1b19bd7
fix: don't append 'null' after output
PranavPurwar Apr 18, 2022
c34b708
debug activity to kotlin
PranavPurwar Apr 19, 2022
0d74cd6
add null safety
PranavPurwar Apr 19, 2022
237bd9f
fix error
PranavPurwar Apr 19, 2022
6e32fa4
fix
PranavPurwar Apr 19, 2022
a7d6e16
toKotlin
PranavPurwar Apr 19, 2022
420b173
use mainactivity.this instead of this
PranavPurwar Apr 20, 2022
2644eca
fix
PranavPurwar Apr 20, 2022
e0229e1
fix
PranavPurwar Apr 20, 2022
39f9472
fix code
PranavPurwar Apr 20, 2022
ed7e5d2
fix warnings
PranavPurwar Apr 20, 2022
bb18923
convert file to kotlin
PranavPurwar Apr 20, 2022
f6acee2
fix compile errors
PranavPurwar Apr 20, 2022
abb705b
fix: use kotlin style variable declaration
PranavPurwar Apr 20, 2022
3c1a5e4
make all fields lateinit
PranavPurwar Apr 20, 2022
ab3f477
cleanup code
PranavPurwar Apr 20, 2022
13a4283
use float to reduce memory footprint
PranavPurwar Apr 20, 2022
45296dd
use float type to compare values
PranavPurwar Apr 20, 2022
c493ce5
lint: fix indentation
PranavPurwar Apr 20, 2022
b81efd8
fix warning
PranavPurwar Apr 20, 2022
751631e
convert main activity to kotlin
PranavPurwar Apr 20, 2022
972a299
return inside the lambda
PranavPurwar Apr 20, 2022
e77b9d9
fix errors
PranavPurwar Apr 20, 2022
e7c7bc4
fix erros
PranavPurwar Apr 20, 2022
2e660d6
fix errors
PranavPurwar Apr 20, 2022
decf04c
fix build errors
PranavPurwar Apr 20, 2022
f86e9da
fix errors
PranavPurwar Apr 20, 2022
90d01f6
Fix error (#100)
LetsDoNothing Jun 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/delete-workflow-runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Delete old workflow runs
on:
workflow_dispatch:

jobs:
del_runs:
runs-on: ubuntu-latest
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 15
keep_minimum_runs: 6
98 changes: 47 additions & 51 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,57 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.pranav.java.ide'
compileSdk 32
namespace 'com.pranav.java.ide'
compileSdk 32

defaultConfig {
applicationId 'com.pranav.java.ide'
minSdk 26
targetSdk 32
versionCode 3
versionName '0.0.3'
}
defaultConfig {
applicationId 'com.pranav.java.ide'
minSdk 26
targetSdk 32
versionCode 3
versionName '0.0.3'
}

buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
multiDexEnabled true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
}

packagingOptions {
resources.excludes.add("plugin.xml")
resources.excludes.add(".options")
resources.excludes.add("about.xml")
resources.excludes.add("plugin.properties")
resources.excludes.add(".api_description")
resources.excludes.add("about_files/*")
resources.excludes.add("META-INF/*")
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

debug {
multiDexEnabled true
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

packagingOptions {
resources.excludes.add("plugin.xml")
resources.excludes.add(".options")
resources.excludes.add("about.xml")
resources.excludes.add("plugin.properties")
resources.excludes.add(".api_description")
resources.excludes.add("about_files/*")
resources.excludes.add("META-INF/*")
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.guava:guava:31.1-android'
implementation 'org.benf:cfr:0.152'
implementation 'org.smali:dexlib2:2.5.2'
implementation 'io.github.Rosemoe.sora-editor:editor:0.10.11'
implementation 'io.github.Rosemoe.sora-editor:language-java:0.10.11'
implementation 'androidx.appcompat:appcompat:1.6.0-alpha01'
implementation 'com.google.android.material:material:1.6.0-beta01'
implementation project(path: ':lib-android')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4-alpha05'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha05'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.guava:guava:31.1-android'
implementation 'org.benf:cfr:0.152'
implementation 'org.smali:dexlib2:2.5.2'
implementation 'io.github.Rosemoe.sora-editor:editor:0.10.11'
implementation 'io.github.Rosemoe.sora-editor:language-java:0.10.11'
implementation 'androidx.appcompat:appcompat:1.6.0-alpha01'
implementation 'com.google.android.material:material:1.6.0-beta01'
implementation project(path: ':lib-android')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4-alpha05'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0-alpha05'
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
// Check the package name of project.
@Test
// Check if app context is accessible.
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.pranav.java.ide", appContext.packageName)
}
@Test
// Check if app context is accessible.
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.pranav.java.ide", appContext.packageName)
}
}
29 changes: 15 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".ApplicationLoader"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="true"
android:supportsRtl="true"
android:theme="@style/Theme.JavaIDE.NoActionBar"
android:resizeableActivity="true"
android:hardwareAccelerated="true"
tools:targetApi="32">
<activity
<application
android:name=".ApplicationLoader"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="true"
android:supportsRtl="true"
android:theme="@style/Theme.JavaIDE.NoActionBar"
android:resizeableActivity="true"
android:hardwareAccelerated="true"
tools:targetApi="32">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
Expand All @@ -27,5 +27,6 @@
<activity
android:name=".DebugActivity"
android:exported="false" />
</application>
</application>

</manifest>
46 changes: 0 additions & 46 deletions app/src/main/java/com/pranav/java/ide/ApplicationLoader.java

This file was deleted.

42 changes: 42 additions & 0 deletions app/src/main/java/com/pranav/java/ide/ApplicationLoader.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.pranav.java.ide

import android.app.AlarmManager
import android.app.Application
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Process
import android.util.Log
import com.pranav.lib_android.util.FileUtil

class ApplicationLoader : Application() {

private lateinit var mContext: Context

override fun onCreate() {
super.onCreate()
mContext = getApplicationContext()
FileUtil.initializeContext(mContext)
val uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()

Thread.setDefaultUncaughtExceptionHandler {
thread, throwable ->
val intent = Intent(mContext, DebugActivity::class.java)
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
intent.putExtra("error", Log.getStackTraceString(throwable))
val pendingIntent =
PendingIntent.getActivity(
mContext, 11111, intent, PendingIntent.FLAG_ONE_SHOT)

val am = getSystemService(Context.ALARM_SERVICE) as AlarmManager
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 0, pendingIntent)

Process.killProcess(Process.myPid())
System.exit(0)

uncaughtExceptionHandler?.uncaughtException(thread, throwable)
}
}

fun getContext(): Context = mContext
}
24 changes: 0 additions & 24 deletions app/src/main/java/com/pranav/java/ide/DebugActivity.java

This file was deleted.

23 changes: 23 additions & 0 deletions app/src/main/java/com/pranav/java/ide/DebugActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.pranav.java.ide

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity

class DebugActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val intent: Intent? = getIntent()
val errorMessage = intent?.getStringExtra("error")!!

AlertDialog.Builder(this)
.setTitle("An error occurred")
.setMessage(errorMessage)
.setPositiveButton("Quit", {_, _ -> finish()})
.create()
.show()
}
}
Loading