Trace Gradle Plugin

Gradle plugin for method invocation tracing

Лицензия

Лицензия

Категории

Категории

Gradle Компиляция и сборка
Группа

Группа

com.sdklite.trace
Идентификатор

Идентификатор

gradle-plugin
Последняя версия

Последняя версия

0.0.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Trace Gradle Plugin
Gradle plugin for method invocation tracing
Ссылка на сайт

Ссылка на сайт

https://github.com/sdklite/trace
Организация-разработчик

Организация-разработчик

SDKLite
Система контроля версий

Система контроля версий

https://github.com/sdklite/trace.git

Скачать gradle-plugin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.sdklite.trace/gradle-plugin/ -->
<dependency>
    <groupId>com.sdklite.trace</groupId>
    <artifactId>gradle-plugin</artifactId>
    <version>0.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.sdklite.trace/gradle-plugin/
implementation 'com.sdklite.trace:gradle-plugin:0.0.3'
// https://jarcasting.com/artifacts/com.sdklite.trace/gradle-plugin/
implementation ("com.sdklite.trace:gradle-plugin:0.0.3")
'com.sdklite.trace:gradle-plugin:jar:0.0.3'
<dependency org="com.sdklite.trace" name="gradle-plugin" rev="0.0.3">
  <artifact name="gradle-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.sdklite.trace', module='gradle-plugin', version='0.0.3')
)
libraryDependencies += "com.sdklite.trace" % "gradle-plugin" % "0.0.3"
[com.sdklite.trace/gradle-plugin "0.0.3"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.javassist : javassist jar 3.20.0-GA
commons-io : commons-io jar 2.4

provided (2)

Идентификатор библиотеки Тип Версия
com.android.tools.build : transform-api jar 1.5.0
com.android.tools.build : gradle jar 1.5.0

Модули Проекта

Данный проект не имеет модулей.

Trace

Trace is a gradle plugin for android project to trace java method invocation, it uses the Transform API and Javassist to manipulate the bytecode, and print the java method with elapsed time to logcat.

Getting Started

Configure this build.gradle like this:

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0' // Or higher version
        classpath 'com.sdklite.trace:gradle-plugin:0.0.2' // HERE
    }
}

Then apply the trace plugin below the android plugin

apply plugin: 'com.sdklite.trace'

Finally, build your project and install the application to your android device, then you can filter the logcat like this:

adb logcat -s trace

Performance optimization

Trace gradle plugin is useful and convinient for performance optimization by dumping the trace log via logcat:

  1. Clean logcat

    adb logcat -c
  2. Launch app

  3. Dump trace log

    adb logcat -d -s trace | awk -F: '{print $NF}' | awk '{printf "%s, %s\n", $1, substr($2, 2)}'

    or filter by elapsed time

    adb logcat -d -s trace | awk -F: '{print $NF}' | awk '{et=strtonum(substr($2,2)); if (et > 30) { printf "%s, %s\n", $1, et}}'
com.sdklite.trace

SDKLite

SDKLite

Версии библиотеки

Версия
0.0.3
0.0.2
0.0.1