-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from klee0kai/release/0.0.6
Release/0.0.6
- Loading branch information
Showing
20 changed files
with
269 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="publish local" type="GradleRunConfiguration" factoryName="Gradle"> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value=":tasktree:publishPluginMavenPublicationToMavenLocal" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<RunAsTest>false</RunAsTest> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
jdk: | ||
- openjdk11 | ||
- openjdk17 | ||
install: | ||
- echo "publish crosscompile plugin" | ||
- ./gradlew :tasktree:publishPluginMavenPublicationToMavenLocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
tasktree/src/main/kotlin/com/github/klee0kai/tasktree/TaskStat.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.github.klee0kai.tasktree | ||
|
||
import com.github.klee0kai.tasktree.utils.getAllDeps | ||
import com.github.klee0kai.tasktree.utils.taskGraph | ||
import org.gradle.api.Project | ||
import org.gradle.api.Task | ||
import org.gradle.kotlin.dsl.provideDelegate | ||
|
||
class TaskStat( | ||
val task: Task, | ||
val allTasks: Set<Task>, | ||
val rootProject: Project, | ||
) { | ||
|
||
val allDepsCount by lazy { rootProject.taskGraph.getAllDeps(task).count() } | ||
val allDependedOnCount by lazy { | ||
allTasks.count { | ||
rootProject.taskGraph | ||
.getAllDeps(it) | ||
.contains(task) | ||
} | ||
} | ||
val price by lazy { allDepsCount } | ||
val importance by lazy { allDependedOnCount } | ||
|
||
val complexPrice by lazy { | ||
(price * importance).toFloat() / allTasks.size | ||
} | ||
|
||
|
||
// ---- outside of project ------ | ||
val allDependedOnOutsideProjectCount by lazy { | ||
allTasks.count { | ||
it.project != task.project && | ||
rootProject.taskGraph | ||
.getAllDeps(it) | ||
.contains(task) | ||
} | ||
} | ||
val importanceOutsideProject by lazy { allDependedOnOutsideProjectCount } | ||
val complexPriceOutsideProject by lazy { (price * importanceOutsideProject).toFloat() / allTasks.size } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tasktree/src/main/kotlin/com/github/klee0kai/tasktree/tasks/BaseReportTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.github.klee0kai.tasktree.tasks | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.api.tasks.diagnostics.ConventionReportTask | ||
import org.gradle.api.tasks.diagnostics.internal.ReportGenerator | ||
import org.gradle.api.tasks.diagnostics.internal.ReportRenderer | ||
import org.gradle.api.tasks.diagnostics.internal.TextReportRenderer | ||
import org.gradle.internal.graph.GraphRenderer | ||
|
||
abstract class BaseReportTask : ConventionReportTask() { | ||
|
||
@Internal | ||
protected val renderer = TextReportRenderer() | ||
|
||
@get:Internal | ||
protected val graphRenderer: GraphRenderer? by lazy { GraphRenderer(renderer.textOutput) } | ||
|
||
abstract fun generate(project: Project) | ||
|
||
@TaskAction | ||
fun generate() { | ||
reportGenerator().generateReport(projects) { | ||
generate(it) | ||
} | ||
} | ||
|
||
override fun getRenderer(): ReportRenderer = renderer | ||
|
||
private fun reportGenerator(): ReportGenerator { | ||
return ReportGenerator( | ||
getRenderer(), | ||
clientMetaData, | ||
outputFile, | ||
textOutputFactory | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.