├── .editorconfig
├── .github
├── dependabot.yml
└── workflows
│ ├── publish-release.yml
│ └── publish-snapshot.yml
├── .gitignore
├── .idea
└── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── LICENSE
├── README.md
├── README_CN.md
├── app
├── .gitignore
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── sample_document.md
│ ├── java
│ └── com
│ │ └── airsaid
│ │ └── example
│ │ ├── MainActivity.kt
│ │ ├── SampleDocumentFragment.kt
│ │ ├── SampleListFragment.kt
│ │ ├── SampleMemoryFragment.kt
│ │ ├── SampleMessageFragment.kt
│ │ ├── SamplePermissionFragment.kt
│ │ ├── SampleSourceCodeFragment.kt
│ │ └── custom
│ │ ├── PathDescription.kt
│ │ ├── component
│ │ ├── BorderComponent.kt
│ │ ├── BorderLayout.java
│ │ ├── SampleBorder.java
│ │ └── SampleBorderActivity.kt
│ │ ├── function
│ │ └── PrintSampleFunction.kt
│ │ └── processor
│ │ ├── AlertDialogActionProcessor.kt
│ │ └── AlertDialogSample.kt
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ ├── activity_main.xml
│ ├── fragment_sample_memory.xml
│ ├── fragment_sample_message.xml
│ └── fragment_sample_text.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-mdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.webp
│ └── ic_launcher_round.webp
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build-logic
├── .gitignore
├── convention
│ ├── .gitignore
│ ├── build.gradle.kts
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ ├── AndroidApplicationConventionPlugin.kt
│ │ ├── AndroidLibraryConventionPlugin.kt
│ │ ├── KtlintConventionPlugin.kt
│ │ └── com
│ │ └── airsaid
│ │ └── sample
│ │ └── KotlinAndroid.kt
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
└── settings.gradle.kts
├── build.gradle.kts
├── gradle.properties
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── preview
├── document.png
├── memory.png
├── message.png
└── source_code.png
├── sample-api
├── .gitignore
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── com
│ └── airsaid
│ └── sample
│ └── api
│ ├── Extension.kt
│ ├── ExtensionItem.kt
│ ├── PathDescription.kt
│ ├── PathItem.kt
│ ├── Register.kt
│ ├── SampleData.kt
│ ├── SampleItem.kt
│ └── TestCase.kt
├── sample-core
├── .gitignore
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── airsaid
│ │ └── sample
│ │ └── core
│ │ ├── AndroidSample.kt
│ │ ├── SampleConstants.kt
│ │ ├── appcompat
│ │ ├── AbstractSampleActivity.kt
│ │ ├── SampleAppCompatActivity.kt
│ │ ├── SampleFragmentContainerActivity.kt
│ │ └── SampleWrapperViewFragment.kt
│ │ ├── component
│ │ ├── ComponentContainer.kt
│ │ └── ComponentManager.kt
│ │ ├── exception
│ │ └── SampleFailedException.kt
│ │ ├── extension
│ │ └── ExtensionHandler.kt
│ │ ├── function
│ │ ├── FunctionManager.kt
│ │ └── SampleFunction.kt
│ │ ├── initializer
│ │ └── AndroidSampleInitializer.kt
│ │ ├── main
│ │ ├── SampleActivityLifeCycleCallback.kt
│ │ ├── adapter
│ │ │ ├── MutableListAdapter.kt
│ │ │ └── SampleListAdapter.kt
│ │ └── component
│ │ │ └── DefaultMainSampleFragment.kt
│ │ ├── model
│ │ └── PathNode.kt
│ │ ├── path
│ │ └── PathProvider.kt
│ │ ├── processor
│ │ ├── ActionProcessManager.kt
│ │ ├── ActionProcessor.kt
│ │ ├── ActivityClassActionProcessor.kt
│ │ ├── DialogFragmentClassActionProcessor.kt
│ │ ├── FragmentClassActionProcessor.kt
│ │ ├── SampleInterface.kt
│ │ └── SampleInterfaceProcessor.kt
│ │ ├── util
│ │ └── Extensions.kt
│ │ └── window
│ │ ├── AppcompatWindowDelegate.kt
│ │ └── WindowDelegate.kt
│ └── res
│ ├── drawable
│ ├── sample_list_divider.xml
│ ├── sample_list_selector.xml
│ └── sample_right_arrow.xml
│ ├── layout
│ ├── sample_activity_fragment_container.xml
│ ├── sample_fragment_main_layout.xml
│ └── sample_list_item.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── sample-extension
├── .gitignore
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── highlight
│ │ ├── androidstudio.css
│ │ ├── base_style.css
│ │ ├── highlight.pack.js
│ │ ├── highlight_template.html
│ │ └── highlightjs-line-numbers.min.js
│ └── markdown
│ │ ├── css_themes
│ │ ├── alt.css
│ │ ├── classic.css
│ │ ├── foghorn.css
│ │ └── paperwhite.css
│ │ ├── js
│ │ ├── markdown.init.js
│ │ └── marked.min.js
│ │ └── markdown.html
│ ├── java
│ └── com
│ │ └── airsaid
│ │ └── sample
│ │ └── extension
│ │ ├── adapter
│ │ ├── SimpleArrayAdapter.java
│ │ └── tree
│ │ │ ├── OnTreeNodeClickListener.java
│ │ │ ├── TreeAdapter.java
│ │ │ ├── TreeLoadCallback.java
│ │ │ └── TreeNode.java
│ │ ├── component
│ │ ├── SamplePagerComponentContainer.kt
│ │ ├── code
│ │ │ ├── SampleFileItemDecoration.java
│ │ │ ├── SampleSourceCode.kt
│ │ │ ├── SampleSourceCodeDialogFragment.java
│ │ │ ├── SampleSourceFileFragmentListFragment.java
│ │ │ ├── adapter
│ │ │ │ └── SampleSourceCodeAdapter.java
│ │ │ └── view
│ │ │ │ └── SourceCodeView.kt
│ │ ├── document
│ │ │ ├── DocumentAssetsManager.java
│ │ │ ├── SampleDocument.java
│ │ │ ├── SampleDocumentFragment.java
│ │ │ └── view
│ │ │ │ └── MarkdownView.java
│ │ ├── memory
│ │ │ ├── CurveChartView.java
│ │ │ ├── MemoryView.java
│ │ │ ├── SampleMemory.java
│ │ │ └── SampleMemoryComponent.kt
│ │ └── message
│ │ │ ├── SampleMessage.java
│ │ │ ├── SampleMessageBindFragment.java
│ │ │ ├── SampleMessageComponent.kt
│ │ │ ├── SampleSlidingLayout.java
│ │ │ ├── SampleSystemConsole.java
│ │ │ └── WorkThread.java
│ │ ├── initializer
│ │ ├── AndroidSampleExtensionInitializer.kt
│ │ └── AndroidSampleExtensions.kt
│ │ ├── permission
│ │ ├── PermissionResult.kt
│ │ ├── PermissionViewModel.kt
│ │ ├── PermissionViewModelProviders.kt
│ │ ├── SamplePermission.kt
│ │ ├── SamplePermissionFunction.kt
│ │ └── SamplePermissionsFragment.kt
│ │ ├── utils
│ │ ├── Charsets.java
│ │ ├── Cheeses.java
│ │ ├── IOUtils.java
│ │ ├── SampleHelper.kt
│ │ ├── SeekBarChangeListenerAdapter.kt
│ │ ├── StringBuilderWriter.java
│ │ └── UrlConnections.java
│ │ └── view
│ │ ├── NestedWebView.java
│ │ ├── RadioLayout.java
│ │ ├── SeekLayout.kt
│ │ ├── SpinnerLayout.kt
│ │ └── WebViewProgressBar.java
│ └── res
│ ├── drawable-xhdpi
│ ├── sample_folder_collapse.png
│ ├── sample_folder_expand.png
│ ├── sample_message_clear.png
│ ├── sample_message_scroll_down.png
│ ├── sample_visibility_off.png
│ └── sample_visibility_on.png
│ ├── drawable
│ ├── sample_action_selector.xml
│ ├── sample_folder_drag_selector.xml
│ ├── sample_visible_selector.xml
│ └── sample_web_progress_drawable.xml
│ ├── layout-land
│ └── sample_message_layout.xml
│ ├── layout
│ ├── sample_fragment_document.xml
│ ├── sample_fragment_source_code.xml
│ ├── sample_fragment_source_code_list.xml
│ ├── sample_fragment_tab.xml
│ ├── sample_list_file_item.xml
│ ├── sample_list_folder_item.xml
│ ├── sample_memory_layout.xml
│ ├── sample_message_layout.xml
│ └── sample_seek_layout.xml
│ └── values
│ ├── attrs.xml
│ ├── color-arrays.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── sample-plugin
├── .gitignore
├── build.gradle.kts
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── airsaid
│ │ └── sample
│ │ └── plugin
│ │ ├── SamplePlugin.kt
│ │ ├── constant
│ │ └── Constants.kt
│ │ ├── extension
│ │ └── SampleExtension.kt
│ │ ├── model
│ │ └── ClassData.kt
│ │ ├── task
│ │ └── MergeSourceFileAndDocTask.kt
│ │ ├── transform
│ │ ├── SampleAsmClassVisitorFactory.kt
│ │ ├── SampleClassVisitor.kt
│ │ └── processor
│ │ │ ├── ClassDataProcessor.kt
│ │ │ ├── ExtensionItemProcessor.kt
│ │ │ ├── PathItemProcessor.kt
│ │ │ ├── SampleItemProcessor.kt
│ │ │ └── SampleProcessor.kt
│ │ └── util
│ │ ├── Extensions.kt
│ │ └── SampleConfigClassCreator.kt
│ └── test
│ └── kotlin
│ └── com
│ └── airsaid
│ └── sample
│ └── plugin
│ ├── SampleGradleRunnerProvider.kt
│ └── SamplePluginTest.kt
├── sample.apk
└── settings.gradle.kts
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*.{kt,kts}]
4 | indent_size = 2
5 | continuation_indent_size = 2
6 | indent_style = space
7 | max_line_length = 120
8 | disabled_rules = no-wildcard-imports
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "gradle"
9 | directory: "/"
10 | schedule:
11 | interval: "weekly"
12 | - package-ecosystem: "github-actions"
13 | directory: "/"
14 | schedule:
15 | interval: "weekly"
16 |
--------------------------------------------------------------------------------
/.github/workflows/publish-release.yml:
--------------------------------------------------------------------------------
1 | name: Publish Release
2 |
3 | on:
4 | push:
5 | tags:
6 | - '*'
7 |
8 | jobs:
9 | publish:
10 |
11 | runs-on: ubuntu-latest
12 | if: github.repository == 'Airsaid/sample-gradle-plugin'
13 |
14 | steps:
15 | - name: Checkout
16 | uses: actions/checkout@v3
17 |
18 | - name: Install JDK 11
19 | uses: actions/setup-java@v3
20 | with:
21 | distribution: 'zulu'
22 | java-version: 11
23 |
24 | - name: Upload release
25 | run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
26 | env:
27 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
28 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
29 | ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
30 | ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
31 |
32 | - name: Publish release
33 | run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
34 | env:
35 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
36 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
37 |
--------------------------------------------------------------------------------
/.github/workflows/publish-snapshot.yml:
--------------------------------------------------------------------------------
1 | name: Publish Snapshot
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | publish:
10 |
11 | runs-on: ubuntu-latest
12 | if: github.repository == 'Airsaid/sample-gradle-plugin'
13 |
14 | steps:
15 | - name: Checkout
16 | uses: actions/checkout@v3
17 |
18 | - name: Install JDK 11
19 | uses: actions/setup-java@v3
20 | with:
21 | distribution: 'zulu'
22 | java-version: 11
23 |
24 | - name: Retrieve version
25 | run: |
26 | echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
27 |
28 | - name: Publish snapshot
29 | run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
30 | if: endsWith(env.VERSION_NAME, '-SNAPSHOT')
31 | env:
32 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
33 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea/inspectionProfiles
5 | .idea/dictionaries
6 | .idea/libraries
7 | .idea/leetcode
8 | .idea/modules
9 | .idea/shelf
10 | .idea/caches
11 | .idea/*.xml
12 | .idea/.gitignore
13 | .idea/.name
14 | !.idea/codeStyles/
15 | .DS_Store
16 | /build
17 | /captures
18 | .externalNativeBuild
19 | .cxx
20 | local.properties
21 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("sample.android.application")
3 | id("sample.ktlint")
4 | id("com.airsaid.sample")
5 | }
6 |
7 | sample {
8 | enableDebug.set(true)
9 | }
10 |
11 | android {
12 | defaultConfig {
13 | applicationId = "com.airsaid.sample"
14 | versionCode = 1
15 | versionName = "1.0.0"
16 | }
17 |
18 | buildTypes {
19 | getByName("release") {
20 | isMinifyEnabled = false
21 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation(libs.androidx.ktx)
28 | implementation(libs.androidx.appcompat)
29 | implementation(libs.android.material)
30 | implementation(libs.androidx.constraintlayout)
31 | testImplementation(libs.junit)
32 | androidTestImplementation(libs.androidx.junit)
33 | androidTestImplementation(libs.androidx.espresso)
34 | implementation(projects.sampleExtension)
35 | }
36 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.kts.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/airsaid/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.airsaid.example
2 |
3 | import android.os.Bundle
4 | import androidx.appcompat.app.AppCompatActivity
5 |
6 | class MainActivity : AppCompatActivity() {
7 | override fun onCreate(savedInstanceState: Bundle?) {
8 | super.onCreate(savedInstanceState)
9 | setContentView(R.layout.activity_main)
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/airsaid/example/SampleDocumentFragment.kt:
--------------------------------------------------------------------------------
1 | package com.airsaid.example
2 |
3 | import android.annotation.SuppressLint
4 | import android.os.Bundle
5 | import android.view.LayoutInflater
6 | import android.view.View
7 | import android.view.ViewGroup
8 | import android.widget.TextView
9 | import androidx.fragment.app.Fragment
10 | import com.airsaid.sample.api.Register
11 | import com.airsaid.sample.extension.component.document.SampleDocument
12 |
13 | @SampleDocument("https://raw.githubusercontent.com/Airsaid/sample-gradle-plugin/master/README.md")
14 | @Register(
15 | title = "SampleDocument",
16 | desc = "Use @SampleDocument to associate documents to sample."
17 | )
18 | class SampleDocumentFragment : Fragment() {
19 |
20 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
21 | return inflater.inflate(R.layout.fragment_sample_text, container, false)
22 | }
23 |
24 | @SuppressLint("SetTextI18n")
25 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
26 | super.onViewCreated(view, savedInstanceState)
27 | view.findViewById(R.id.textView).apply {
28 | text = "Click the ${requireContext().resources.getString(R.string.sample_document)} " +
29 | "table to see the associated document."
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/airsaid/example/SampleListFragment.kt:
--------------------------------------------------------------------------------
1 | package com.airsaid.example
2 |
3 | import android.Manifest
4 | import android.annotation.SuppressLint
5 | import android.os.Bundle
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import android.widget.Button
10 | import android.widget.TextView
11 | import androidx.fragment.app.Fragment
12 | import com.airsaid.sample.api.Register
13 | import com.airsaid.sample.extension.component.code.SampleSourceCode
14 | import com.airsaid.sample.extension.component.document.SampleDocument
15 | import com.airsaid.sample.extension.component.memory.SampleMemory
16 | import com.airsaid.sample.extension.component.message.SampleMessage
17 | import com.airsaid.sample.extension.permission.SamplePermission
18 |
19 | @Register(
20 | title = "SampleList",
21 | desc = "Multiple sample annotations can be used together."
22 | )
23 | @SampleMemory
24 | @SampleMessage
25 | @SampleSourceCode("SampleListFragment.kt")
26 | @SampleDocument("assets://sample_document.md")
27 | @SamplePermission(Manifest.permission.READ_EXTERNAL_STORAGE)
28 | class SampleListFragment : Fragment() {
29 |
30 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
31 | return inflater.inflate(R.layout.fragment_sample_message, container, false)
32 | }
33 |
34 | @SuppressLint("SetTextI18n")
35 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
36 | super.onViewCreated(view, savedInstanceState)
37 | view.findViewById(R.id.textView).apply {
38 | text = "Multiple sample annotations can be used together."
39 | }
40 | view.findViewById