plantuml-gradle-plugin
plantuml-gradle-plugin copied to clipboard
Not compatible Android Studio gradle
Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'compileClasspath' not found.
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.createNotFoundException(DefaultConfigurationContainer.java:160)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:332)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:150)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:63)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getAt(DefaultNamedDomainObjectCollection.java:352)
at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getAt(DefaultConfigurationContainer.java:63)
at org.gradle.api.artifacts.ConfigurationContainer$getAt.call(Unknown Source)
at com.github.roroche.plantuml.urls.CompileClasspathUrls.
Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.createNotFoundException(DefaultNamedDomainObjectCollection.java:503)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:332)
at org.gradle.api.NamedDomainObjectCollection$getByName.call(Unknown Source)
at com.github.roroche.plantuml.urls.MainOutputUrls.
Have you gotten anywhere on this? I'm having a similar issue.
Have you gotten anywhere on this? I'm having a similar issue.
No :(
Were you attempting to document a framework? Because I was. I reached the conclusion that the error SourceSet with name 'main' not found
indicated that the plugin was unable to find an entry point to the code to start building the documentation. As I dug into the source, it looks like there's no way for the user to change that. We'd have to modify the project.
I have a similar problem with Android Studio Chipmunk | 2021.2.1 Patch 2.
I started a new project from the template Basic Activity:
To the project-level build.gradle
file I had to add (this is not in the plugin documentation):
plugins {
id ' java'
}
configurations {
compileClasspath
}
But then I finally get Invalid package 'com.example.myapplication', maybe missing or empty
which is implying that the reflection used to find the packages isn't working.
./gradlew buildClassDiagram
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :buildClassDiagram FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildClassDiagram'.
> Invalid package 'com.example.myapplication', maybe missing or empty
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
EDIT
Here's my My\Application\build.gradle
finally:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id "com.github.roroche.plantuml" version "1.0.2"
id 'java'
}
//task clean(type: Delete) {
// delete rootProject.buildDir
//}
configurations {
compileClasspath
}
classDiagram { // (1)
packageName = "com.example.myapplication" // (2)
outputFile = project.file('diagrams/class_diagram.plantuml') // (3)
// outputFile = new File("${projectDir}/diagrams/class_diagram.plantuml") // (4)
// ignoredClasses = [ // (5)
// "com.github.roroche.plantuml.diagrams.Diagram\$Simple",
// "com.github.roroche.plantuml.diagrams.Diagram\$Wrap",
// "com.github.roroche.plantuml.classes.Classes\$Simple",
// "com.github.roroche.plantuml.classes.Classes\$Wrap"
// ]
}
I forked and rewrote the plugin and did my best to make it compatible with Android Studio: https://plugins.gradle.org/plugin/io.gitlab.plunts.plantuml
I'm open for suggestions if anything is still not working, since I actually don't use Android Studio myself.