Skip to content

Commit

Permalink
Publishing a technical preview version (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
jisungbin committed Jan 20, 2024
1 parent 8becb24 commit f3571f1
Show file tree
Hide file tree
Showing 105 changed files with 591 additions and 567 deletions.
21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

72 changes: 53 additions & 19 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We as members, contributors, and leaders pledge to make participation in our community a
harassment-free experience for everyone, regardless of age, body size, visible or invisible
disability, ethnicity, sex characteristics, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and
healthy community.

## Our Standards

Expand All @@ -13,67 +18,96 @@ Examples of behavior that contributes to a positive environment for our communit
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the
experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Publishing others' private information, such as a physical or email address, without their
explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior
and will take appropriate and fair corrective action in response to any behavior that they deem
inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits,
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and
will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
This Code of Conduct applies within all community spaces, and also applies when an individual is
officially representing the community in public spaces. Examples of representing our community
include using an official e-mail address, posting via an official social media account, or acting as
an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community
leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated
promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.
All community leaders are obligated to respect the privacy and security of the reporter of any
incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
Community leaders will follow these Community Impact Guidelines in determining the consequences for
any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or
unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
**Consequence**: A private, written warning from community leaders, providing clarity around the
nature of the violation and an explanation of why the behavior was inappropriate. A public apology
may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people
involved, including unsolicited interaction with those enforcing the Code of Conduct, for a
specified period of time. This includes avoiding interactions in community spaces as well as
external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Community Impact**: A serious violation of community standards, including sustained inappropriate
behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
**Consequence**: A temporary ban from any sort of interaction or public communication with the
community for a specified period of time. No public or private interaction with the people involved,
including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this
period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating a pattern of violation of community standards, including
sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement
of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available
at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired
by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
For answers to common questions about this code of conduct, see the FAQ
at https://www.contributor-covenant.org/faq. Translations are available
at https://www.contributor-covenant.org/translations.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ jobs:
with:
gradle-home-cache-cleanup: true

- name: Code style checks
run: ./gradlew ktlintCheck

- name: Run test
run: ./gradlew test --stacktrace

- name: Run build
- name: Run build (includes testing and spotless check)
run: ./gradlew build --stacktrace

- name: Upload reports
Expand Down
7 changes: 0 additions & 7 deletions .idea/copyright/MIT.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ Composable's forced invalidation[^1] request and invalidation tree building tool

[^1]: Commonly known as "recomposition".

This tool was started for personal learning and is not proven to be necessary in production, but it can do the following things:
This tool was started for personal learning and is not proven to be necessary in production, but it
can do the following things:

- **Request to force invalidate a Composable:** Forces the Composable to be invalidated without handling `State`.
- **Request to force dispose a Composable:** Disposing of a Composable will initialize any items cached by `key`, such as `remember`, `LaunchedEffect`, and `DisposableEffect`. That is, it initializes the Composable and requests an initial-composition.
- **Record "real" re-composed Composable:** Simply adding logs to a Composable function and seeing them printed doesn't mean that recomposition has occurred; this feature only logs when it's actually recomposed. ("fake" and "real" recompositions will be discussed in more detail later.)
- **Request to force invalidate a Composable:** Forces the Composable to be invalidated without
handling `State`.
- **Request to force dispose a Composable:** Disposing of a Composable will initialize any items
cached by `key`, such as `remember`, `LaunchedEffect`, and `DisposableEffect`. That is, it
initializes the Composable and requests an initial-composition.
- **Record "real" re-composed Composable:** Simply adding logs to a Composable function and seeing
them printed doesn't mean that recomposition has occurred; this feature only logs when it's
actually recomposed. ("fake" and "real" recompositions will be discussed in more detail later.)

- **When the root Composable is recomposed, record the child Composables that are recomposed with it:** Help easily identify tangled Composables.
- **When the root Composable is recomposed, record the child Composables that are recomposed with
it:** Help easily identify tangled Composables.

The first and second features can be useful for people who want to control the Composable lifecycle without being tied to a `State` or Compose Runtime.
The first and second features can be useful for people who want to control the Composable lifecycle
without being tied to a `State` or Compose Runtime.

---

Expand Down Expand Up @@ -43,8 +51,10 @@ The core principle behind this tool is the Kotlin Compiler Plugin.

The tool works in two steps.

1. IR modulation of the Composable function. However, this step is performed before the Compose Compiler.
2. Re-modulating the IR that the Compose Compiler has modulated. It intercepts the IRs that Compose Compiler changes and re-morphs them for this tool.
1. IR modulation of the Composable function. However, this step is performed before the Compose
Compiler.
2. Re-modulating the IR that the Compose Compiler has modulated. It intercepts the IRs that Compose
Compiler changes and re-morphs them for this tool.

... TBD

Expand Down
55 changes: 42 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Designed and developed by Ji Sungbin 2023.
* Developed by Ji Sungbin 2024.
*
* Licensed under the MIT.
* Please see full license: https://github.com/jisungbin/ComposeInvestigator/blob/main/LICENSE
Expand All @@ -9,13 +9,13 @@ import com.adarshr.gradle.testlogger.TestLoggerExtension
import com.adarshr.gradle.testlogger.theme.ThemeType
import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.api.variant.HasUnitTestBuilder
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension

plugins {
alias(libs.plugins.spotless) apply false
alias(libs.plugins.test.gradle.logging) apply false
alias(libs.plugins.gradle.publish.maven) apply false
alias(libs.plugins.kotlin.ktlint) apply false
}

buildscript {
Expand All @@ -30,7 +30,7 @@ buildscript {
}

dependencies {
classpath(libs.kotlin.gradle)
classpath(libs.kotlin.gradle.core)
classpath(libs.gradle.android)
}
}
Expand All @@ -47,23 +47,52 @@ subprojects {
}

apply {
plugin(rootProject.libs.plugins.spotless.get().pluginId)
plugin(rootProject.libs.plugins.test.gradle.logging.get().pluginId)
plugin(rootProject.libs.plugins.kotlin.ktlint.get().pluginId)
}

afterEvaluate {
extensions.configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
ktlint(rootProject.libs.versions.ktlint.get()).editorConfigOverride(
mapOf(
"indent_size" to "2",
"ktlint_standard_filename" to "disabled",
"ktlint_standard_package-name" to "disabled",
"ktlint_standard_property-naming" to "disabled",
"ktlint_standard_function-naming" to "disabled",
"ktlint_standard_import-ordering" to "disabled",
"ktlint_standard_max-line-length" to "disabled",
"ktlint_standard_annotation" to "disabled",
"ktlint_standard_multiline-if-else" to "disabled",
"ktlint_standard_value-argument-comment" to "disabled",
"ktlint_standard_value-parameter-comment" to "disabled",
)
)
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
}
}

extensions.configure<TestLoggerExtension> {
theme = ThemeType.MOCHA_PARALLEL
slowThreshold = 10_000
}

extensions.configure<KtlintExtension> {
version.set(rootProject.libs.versions.kotlin.ktlint.source.get())
android.set(true)
verbose.set(true)
}

// From: https://github.com/chrisbanes/tivi/blob/0865be537f2859d267efb59dac7d6358eb47effc/gradle/build-logic/convention/src/main/kotlin/app/tivi/gradle/Android.kt#L28-L34
// From https://github.com/chrisbanes/tivi/blob/0865be537f2859d267efb59dac7d6358eb47effc/gradle/build-logic/convention/src/main/kotlin/app/tivi/gradle/Android.kt#L28-L34
extensions.findByType<AndroidComponentsExtension<*, *, *>>()?.run {
beforeVariants(selector().withBuildType("release")) { variantBuilder ->
(variantBuilder as? HasUnitTestBuilder)?.apply {
Expand All @@ -89,6 +118,6 @@ subprojects {
}
}

tasks.register("cleanAll", type = Delete::class) {
tasks.register<Delete>("cleanAll") {
allprojects.map { project -> project.layout.buildDirectory }.forEach(::delete)
}
17 changes: 0 additions & 17 deletions compiler-base/build.gradle.kts

This file was deleted.

4 changes: 0 additions & 4 deletions compiler-base/gradle.properties

This file was deleted.

4 changes: 0 additions & 4 deletions compiler-callstack-track/gradle.properties

This file was deleted.

Loading

0 comments on commit f3571f1

Please sign in to comment.