Skip to content

Commit

Permalink
Constants created
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilkyo committed Nov 24, 2023
1 parent 787dd88 commit c51daf2
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ bin/
/.idea/misc.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/vcs.xml
/comparer/
8 changes: 6 additions & 2 deletions build.gradle.kts → build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ repositories {
dependencies {
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'

testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
}
tasks.test {
useJUnitPlatform()
}
}
File renamed without changes.
File renamed without changes.
50 changes: 50 additions & 0 deletions src/main/java/org/tg/themevariables/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package org.tg.themevariables;

import java.util.Map;

public class Constants {

public static final Map<String, String> ANDROID = Map.of(
"MethodName", "createColorKeysMap",
"ClassName", "ThemeColors.java",
"RepoPath", "https://raw.githubusercontent.com/DrKLO/Telegram/master/TMessagesProj"
+ "/src/main/java/org/telegram/ui/ActionBar/",
"SaveDir", "./parsed/android/"
);

public static final Map<String, String> ANDROIDX = Map.of(
"MethodName", "",
"ClassName", "",
"RepoPath", "",
"SaveDir", ""
);

public static final Map<String, String> UNIGRAM = Map.of(
"MethodName", "",
"ClassName", "",
"RepoPath", "",
"SaveDir", ""
);

public static final Map<String, String> DESKTOP = Map.of(
"MethodName", "",
"ClassName", "",
"RepoPath", "",
"SaveDir", ""
);

public static final Map<String, String> IOS = Map.of(
"MethodName", "",
"ClassName", "",
"RepoPath", "",
"SaveDir", ""
);

public static final Map<String, String> MACOS = Map.of(
"MethodName", "",
"ClassName", "",
"RepoPath", "",
"SaveDir", ""
);

}
5 changes: 1 addition & 4 deletions src/main/java/org/tg/themevariables/FindVariables.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@ private static void writeToFile(String fileName, List<String> list) {
}

public static void main(String[] args) {
String fileURL = "https://raw.githubusercontent.com/DrKLO/Telegram/master/TMessagesProj" +
"/src/main/java/org/telegram/ui/ActionBar/ThemeColors.java";
String saveDir = "./parse/";

final String fileName = saveDir + "ThemeColors.java";
final String methodName = "createColorKeysMap";

downloadFile(fileURL, saveDir);
downloadFile(Constants.ANDROID.get("fileURL"), Constants.ANDROIDX.get("SaveDir"));

List<String> variablesList = readInFile(fileName, methodName);
List<String> result = parseData(variablesList);
Expand Down

0 comments on commit c51daf2

Please sign in to comment.