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

Issue with Tasks Not Found in Subproject in Multi-Project Setup #703

Open
arishtj opened this issue Jan 24, 2024 · 2 comments
Open

Issue with Tasks Not Found in Subproject in Multi-Project Setup #703

arishtj opened this issue Jan 24, 2024 · 2 comments

Comments

@arishtj
Copy link

arishtj commented Jan 24, 2024

I am experiencing an issue with the Axion release plugin in a multi-project Gradle setup. Despite configuring the plugin in the root project and setting up a monorepo configuration, tasks such as currentVersion is not being recognized in proja subproject.

Here's what I did:
Applied the Axion release plugin in the root project's build.gradle.kts.
Configured scmVersion in the root project for a monorepo setup.
Attempt to run ./gradlew :proja:currentVersion from the root directory.

Expected Behavior:
The currentVersion task should provide the current version of the proja subproject. Or I would at least expect running ./gradlew cV would show versions of all the configured subprojects alongside the root.
Actual Behavior:
The task currentVersion is not found in the proja subproject. The command ./gradlew :proja:currentVersion results in a "Task not found" error.

Root Project Configuration (build.gradle.kts):

buildscript {
    repositories {
        mavenCentral()
    }
}

plugins {
    id("pl.allegro.tech.build.axion-release") version "1.16.1"
}

scmVersion {
    monorepo {
      //  exclude(project.subprojects.map { it.path })
        include(listOf("proja"))
    }
}
version = scmVersion.version

allprojects {
    project.version = rootProject.version
}

Additionally, the settings.gradle.kts does include this sub-project. Also, I have tried other permutations and combinations too, such as adding the scmVersion block for the sub-project's gradle.build.kts but that still throws an error for being unrecognisable.
Not sure what I am missing.
Ideally I want a configuration where the root can handle which projects to include and exclude and also have the subprojects configurable to say which other sub projects to bump up and exclude. Thank you!

@arishtj
Copy link
Author

arishtj commented Feb 16, 2024

@gabrieljones @vbuell @szpak @bgalek
any guidance on my issue? I am new to gradle, so apologies for any misconfigurations on my end. Appreciate the help!

@bgalek
Copy link
Member

bgalek commented Feb 16, 2024

Hi, if I understand correctly you are setting project.version = rootProject.version to all subprojects - so basicaly you have one version for each module (which seems reasonable) then you don't need to use mono repo settings. You don't need current version task in submodules since all will have the same version. So for me, you just apply the plugin on root project (try using only default values). In your submodules use root project.scmVersion as your version and that should be all you need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants