Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin update #7

Merged
merged 5 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/publishConnectorPlugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5

- name: Build and publish connector plugin
run: ./gradlew publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_SECRET }}
- name: Validate connector plugin
run: ./gradlew :connector-plugin:validatePlugins

- name: Publish connector plugin
run: ./gradlew :connector-plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PLUGIN_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PLUGIN_SECRET }}
10 changes: 5 additions & 5 deletions .idea/gradle.xml

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

4 changes: 2 additions & 2 deletions .idea/kotlinc.xml

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

3 changes: 3 additions & 0 deletions .idea/modules.xml

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

19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ individual modules with the help of [Mermaid](https://mermaid.js.org/).
graph TD
vd2a57d(app) -->|implementation| va74ad8(core)
vd2a57d(app) -->|implementation| v1bc49d(importer)
va02543(connector-plugin) -->|implementation| v91bd8e(connector-model)
va02543(connector-plugin) -->|compileOnly| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| va74ad8(core)
```
Expand Down Expand Up @@ -78,15 +78,12 @@ Download and setup this project:
git clone https://github.com/ryru/dependency-graph-analyser.git
cd dependency-graph-analyser/
./gradlew clean install
./gradlew :connector-plugin:publishToMavenLocal
```

1. Download the GitHub code repository
2. Change into code directory
3. Make a clean installation of the application (application will be available in the
directory `./app/build/install/dga/bin/dga`)
4. Publish the Gradle tooling API plugin and its data model to Maven local (available in the
directory `~/.m2/repository/ch/addere/dga/`)
3. Make a clean installation of the application (application will be available in the directory
`./app/build/install/dga/bin/dga`)

Get an overview of this project by running `dga .`:

Expand All @@ -95,7 +92,7 @@ Get an overview of this project by running `dga .`:

Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)

```

Expand All @@ -108,12 +105,12 @@ Use `dga . --chart-mermaid` to generate a Mermaid chart of this project:

Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)

graph TD
vd2a57d(app) -->|implementation| va74ad8(core)
vd2a57d(app) -->|implementation| v1bc49d(importer)
va02543(connector-plugin) -->|implementation| v91bd8e(connector-model)
va02543(connector-plugin) -->|compileOnly| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| v91bd8e(connector-model)
v1bc49d(importer) -->|implementation| va74ad8(core)

Expand All @@ -127,9 +124,9 @@ containing the dependencies originating from the module `app`:
```
./app/build/install/dga/bin/dga . -o app --mermaid-graph

Analyse project "dependency-graph-analyser"
Analyse project "dependency-graph-analyser"
5 modules
5 dependency configurations (1 unique dependency configurations)
5 dependency configurations (2 unique dependency configurations)

Applying filter on data results in:
3 modules
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("ch.addere.dga.kotlin-application-conventions")
id("dga.application-conventions")
}

description = "CLI application project"
Expand Down
8 changes: 0 additions & 8 deletions build-logic/settings.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 3 additions & 4 deletions build-logic/build.gradle.kts → buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.0")
implementation("com.gradle.publish:plugin-publish-plugin:1.3.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20")
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
jvmToolchain(21)
}
1 change: 1 addition & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "buildSrc"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("dga.common-conventions")
application
}
4 changes: 4 additions & 0 deletions buildSrc/src/main/kotlin/dga.library-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("dga.common-conventions")
`java-library`
}
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/dga.plugin-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id("dga.common-conventions")
`java-gradle-plugin`
id("com.gradle.plugin-publish")
}
18 changes: 1 addition & 17 deletions connector-model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
plugins {
id("ch.addere.dga.kotlin-library-conventions")
`maven-publish`
id("dga.library-conventions")
}

description = "Data model of the analysed Gradle project"

group = "ch.addere.dga.connectormodel"
version = property("connectorPluginVersion").toString()

publishing {
repositories {
maven {
name = "pluginRepo"
url = uri(layout.projectDirectory.dir("../build/pluginRepo"))
}

publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
}
}
}
}
32 changes: 8 additions & 24 deletions connector-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
plugins {
id("ch.addere.dga.kotlin-library-conventions")
`java-gradle-plugin`
`maven-publish`
id("com.gradle.plugin-publish") version "1.2.1"
id("dga.plugin-conventions")
}

description = "Gradle plugin that is injected into to be analysed Gradle projects"
Expand All @@ -11,7 +8,13 @@ group = "ch.addere.dga.connectorplugin"
version = property("connectorPluginVersion").toString()

dependencies {
implementation(project(":connector-model"))
compileOnly(project(":connector-model"))
}

/* Include the :connector-model classes into the plugin jar to make it self-contained */
tasks.named<Jar>("jar") {
from(project.sourceSets["main"].output)
from(project(":connector-model").sourceSets["main"].output)
}

gradlePlugin {
Expand All @@ -30,22 +33,3 @@ gradlePlugin {
}
}
}

publishing {
repositories {
maven {
name = "pluginRepo"
url = uri(layout.projectDirectory.dir("../build/pluginRepo"))
}

publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
}
}
}
}

tasks.withType<PublishToMavenLocal> {
dependsOn(tasks.getByPath(":connector-model:publishToMavenLocal"))
}
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("ch.addere.dga.kotlin-library-conventions")
id("dga.library-conventions")
}

description = "Core logic for analysing dependency graphs"
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
org.gradle.parallel=true
org.gradle.caching=true
connectorPluginVersion=0.1.2
connectorPluginVersion=0.1.5
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion importer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id("ch.addere.dga.kotlin-library-conventions")
id("dga.library-conventions")
`java-gradle-plugin`
}

Expand Down
3 changes: 1 addition & 2 deletions importer/src/main/resources/init.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
initscript {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}

dependencies {
Expand Down
6 changes: 1 addition & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
pluginManagement {
includeBuild("build-logic")
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}

rootProject.name = "dependency-graph-analyser"
Expand Down
Loading