Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Enable use in subprojects #61

Merged
merged 4 commits into from
Apr 14, 2023
Merged

Conversation

Joaquimmnetto
Copy link
Contributor

@Joaquimmnetto Joaquimmnetto commented Apr 6, 2023

Description

This plugin is no longer limited to the root project. On each project the plugin applies its version to all its child projects. This way, child projects without the plugin receives the version of the nearest parent with an applied plugin.

For instance, in the example below, projectA, subproject2 and projectC don't apply net.wooga.version, so their version are determined by the closest parent who does.

rootProject applies v4.0.0      -> rootProject.version == 4.0.0
├── subproject1 applies v1.0.0  -> subproject1.version == 1.0.0
│   ├── projectA (no apply)     -> projectA.version == subproject1.version == 1.0.0
│   └── projectB applies v0.0.1 -> projectB.version == 0.0.1
└── subproject2 (no apply)      -> subproject2.version == rootProject.version == 4.0.0
    ├── projectC (no apply)     -> projectC.version == rootProject.version == 4.0.0 
    └── projectD applies v2.1.0 -> projectD.version = 2.1.0

In projectA case it inherits its version from subproject1 and subproject2 and projectC inherits their version from rootProject. If there is no such available parent, no version is applied.

In meanwhile, rootProject, projectB and projectD apply their own net.wooga.version and so the inherited version is overwritten with the one generated by their own plugin instance.

Based on #60 , please merge that first.

Changes

  • IMPROVE enable use in gradle subprojects

@Joaquimmnetto Joaquimmnetto self-assigned this Apr 6, 2023
@Joaquimmnetto Joaquimmnetto changed the base branch from master to improve/inputs April 6, 2023 13:37
@Joaquimmnetto Joaquimmnetto force-pushed the change/enable-subprojects branch 2 times, most recently from 14db8cc to aa62c31 Compare April 12, 2023 08:58
@Joaquimmnetto Joaquimmnetto requested a review from Larusso April 12, 2023 09:34
@Joaquimmnetto Joaquimmnetto changed the base branch from improve/inputs to release/3.x April 14, 2023 14:10
@Joaquimmnetto Joaquimmnetto force-pushed the change/enable-subprojects branch from c0d5895 to 1476f0b Compare April 14, 2023 14:53
@Joaquimmnetto Joaquimmnetto merged commit 2ab8b2b into release/3.x Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants