Skip to content

Commit

Permalink
add hugo2, stick module
Browse files Browse the repository at this point in the history
  • Loading branch information
s1rius committed Jun 9, 2021
1 parent 23abac5 commit 6e73fcf
Show file tree
Hide file tree
Showing 65 changed files with 1,266 additions and 104 deletions.
16 changes: 0 additions & 16 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ buildscript {

dependencies {
classpath Deps.ByteX.base
classpath Deps.WillFix.willFixStandAlonePlugin
classpath Deps.WillFix.willFixByteX
classpath Deps.WillFix.byteX
classpath Deps.Stick.byteX
classpath Deps.Hugo2.byteX
classpath ClassPaths.firebasePref // Performance Monitoring plugin
}
}
Expand Down Expand Up @@ -54,9 +55,12 @@ dependencies {
implementation Deps.Kotlin.ktxCore
implementation Deps.AndroidX.appcompat
implementation Deps.firebasePref
implementation Deps.WillFix.willFixCore

implementation Deps.Stick.core
implementation Deps.Hugo2.core
}

apply from: "$rootDir/gradle/plugin-bytex.gradle"
//apply from: "$rootDir/gradle/plugin-standalone.gradle"
apply from: "$rootDir/app/plugin-bytex.gradle"
apply from: "$rootDir/app/plugin-stick.gradle"
apply from: "$rootDir/app/plugin-hugo2.gradle"
apply from: "$rootDir/app/plugin-willfix.gradle"
//apply from: "$rootDir/app/plugin-willfix-standalone.gradle"
6 changes: 6 additions & 0 deletions app/plugin-bytex.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply plugin: 'bytex'
ByteX {
enable true
enableInDebug true
logLevel "DEBUG"
}
6 changes: 6 additions & 0 deletions app/plugin-hugo2.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apply plugin: "s1.hugo2.bytex"
hugo2ByteX {
enable true
enableInDebug true
logLevel "DEBUG"
}
7 changes: 7 additions & 0 deletions app/plugin-stick.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apply plugin: "s1.stick.bytex"
stickByteX {
enable true
enableInDebug true
enableAnnotation true
logLevel "DEBUG"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ willFix {
logLevel "INFO"
exceptionHandler "wtf.s1.willfix.ExceptionHandler#log#(Ljava/lang/Exception;)V"
methodList = [
"wtf.s1.willfix.Test#getMsgSize#()I",
"wtf.s1.willfix.Test#setError#(I)V",
"wtf.s1.pudge.Test#getMsgSize#()I",
"wtf.s1.pudge.Test#setError#(I)V",
"com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback#onResponse#(Lokhttp3/Call;Lokhttp3/Response;)V"
]
}
12 changes: 12 additions & 0 deletions app/plugin-willfix.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply plugin: "s1.willfix.bytex"
willFixByteX {
enable true
enableInDebug true
logLevel "DEBUG"
exceptionHandler "wtf.s1.pudge.ExceptionHandler#log#(Ljava/lang/Exception;)V"
methodList = [
"wtf.s1.pudge.Test#getMsgSize#()I",
"wtf.s1.pudge.Test#setError#(I)V",
"com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback#onResponse#(Lokhttp3/Call;Lokhttp3/Response;)V"
]
}
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="wtf.s1.willfix">
package="wtf.s1.pudge">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name="wtf.s1.pudge.App"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.WillFix">
<activity android:name="wtf.s1.willfix.MainActivity">
<activity android:name="wtf.s1.pudge.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
37 changes: 37 additions & 0 deletions app/src/main/java/wtf/s1/pudge/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package wtf.s1.pudge

import android.app.Application
import android.content.Context
import android.util.Log
import wtf.s1.pudge.hugo2.Hugo2
import wtf.s1.stick.core.ITracer
import wtf.s1.stick.core.MethodTrace

class App: Application() {

override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
MethodTrace.setImpl(object: ITracer {

override fun i(method: Int) {

}

override fun o(method: Int) {

}
})

Hugo2.setLogger(object: Hugo2.Hugo2Logger {
override fun logI(clazz: String, method: String, params: String) {
super.logI(clazz, method, params)
Log.i("hugo", "---> $clazz $method $params")
}

override fun logO(clazz: String, method: String) {
super.logO(clazz, method)
Log.i("hugo", "<--- $clazz $method")
}
})
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wtf.s1.willfix
package wtf.s1.pudge

import android.util.Log

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package wtf.s1.willfix
package wtf.s1.pudge

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import wtf.s1.pudge.R

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val a = Test()
a.setError(0)
a.testStick(false, 4, null, intArrayOf(1,9,9,7,0,7,0,1))
Log.i("willfix", "${a.msgSize}")
}
}
33 changes: 33 additions & 0 deletions app/src/main/java/wtf/s1/pudge/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package wtf.s1.pudge;

import wtf.s1.pudge.hugo2.DebugLog;
import wtf.s1.stick.core.Stick;

public class Test {

public String msg;
public int error;

@Stick
public int getMsgSize() {
return msg.length();
}

@Stick
public void setError(int err) {
error = 100 / err;
}

@Stick
@DebugLog
public void testStick(boolean b, int i, String s, int[] ooo) {
StringBuilder sb = new StringBuilder();
sb.append(b);
sb.append(i);
sb.append(s);
if (ooo != null) {
sb.append(ooo.length);
}
System.out.print(sb);
}
}
15 changes: 0 additions & 15 deletions app/src/main/java/wtf/s1/willfix/Test.java

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="wtf.s1.pudge.MainActivity">

<TextView
android:layout_width="wrap_content"
Expand Down
18 changes: 14 additions & 4 deletions buildSrc/src/main/java/wtf/s1/buildsrc/Configs.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package wtf.s1.buildsrc

object Versions{
const val willFix = "0.1.1"
const val pudge = "0.1.1"
const val asm = "8.0.1"
const val kotlin = "1.5.0"
const val ktx = "1.0.0"
Expand Down Expand Up @@ -56,9 +56,19 @@ object Deps{
}

object WillFix {
const val willFixCore = "wtf.s1.pudge:will-fix-core:${Versions.willFix}"
const val willFixStandAlonePlugin = "wtf.s1.pudge:will-fix-plugin:${Versions.willFix}"
const val willFixByteX = "wtf.s1.pudge:will-fix-bytex:${Versions.willFix}"
const val core = "wtf.s1.pudge:will-fix-core:${Versions.pudge}"
const val standAlonePlugin = "wtf.s1.pudge:will-fix-plugin:${Versions.pudge}"
const val byteX = "wtf.s1.pudge:will-fix-bytex:${Versions.pudge}"
}

object Stick {
const val core = "wtf.s1.pudge:stick-core:${Versions.pudge}"
const val byteX = "wtf.s1.pudge:stick-bytex:${Versions.pudge}"
}

object Hugo2 {
const val core = "wtf.s1.pudge:hugo2-core:${Versions.pudge}"
const val byteX = "wtf.s1.pudge:hugo2-bytex:${Versions.pudge}"
}

const val firebasePref = "com.google.firebase:firebase-perf:19.0.9"
Expand Down
37 changes: 37 additions & 0 deletions gradle/android-lib-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}


version = VERSION_NAME
group = GROUP

apply from: rootProject.file('release.gradle')
14 changes: 14 additions & 0 deletions gradle/lib-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apply plugin: 'kotlin'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}

version = VERSION_NAME
group = GROUP

apply from: rootProject.file('release.gradle')
15 changes: 15 additions & 0 deletions gradle/plugin-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apply plugin: 'java-gradle-plugin'
apply plugin: 'kotlin'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}

version = VERSION_NAME
group = GROUP

apply from: rootProject.file('release.gradle')
19 changes: 0 additions & 19 deletions gradle/plugin-bytex.gradle

This file was deleted.

1 change: 1 addition & 0 deletions hugo2-bytex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
12 changes: 12 additions & 0 deletions hugo2-bytex/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply from: rootProject.file('gradle/plugin-build.gradle')

import wtf.s1.buildsrc.ClassPaths
import wtf.s1.buildsrc.Deps

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly(ClassPaths.gradlePlugin)
implementation(ClassPaths.gradleApi)
implementation(Deps.ByteX.common)
implementation(project(':hugo2-core'))
}
5 changes: 5 additions & 0 deletions hugo2-bytex/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POM_NAME=hugo2-bytex
POM_DESCRIPTION=hugo bytex plugin
POM_ARTIFACT_ID=hugo2-bytex
POM_PACKAGING=aar
VERSION_NAME=0.1.1
Loading

0 comments on commit 6e73fcf

Please sign in to comment.