-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tycho-versions-plugin: Support ci-friendly versions
In PomFile#getVersion(), resolve properties used in the raw version of the project. This is necessary so that downstream manipulators (MANIFEST.MF, feature.xml, category.xml, ...) can see the actual version and act on it. Fixes #3744.
- Loading branch information
Showing
6 changed files
with
136 additions
and
23 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
tycho-its/projects/tycho-version-plugin/set-version/ci_friendly/META-INF/MANIFEST.MF
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,6 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Test Artifact | ||
Bundle-SymbolicName: test.artifact | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-17 |
23 changes: 23 additions & 0 deletions
23
tycho-its/projects/tycho-version-plugin/set-version/ci_friendly/pom.xml
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,23 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>test.artifact</artifactId> | ||
<groupId>org.tycho.its</groupId> | ||
<packaging>eclipse-plugin</packaging> | ||
<properties> | ||
<revision>1.0.0-SNAPSHOT</revision> | ||
</properties> | ||
<version>${revision}</version> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-maven-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<extensions>true</extensions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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
24 changes: 24 additions & 0 deletions
24
tycho-versions-plugin/src/main/java/org/eclipse/tycho/versions/pom/PomVersionsUtil.java
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 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 SAP SE and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* SAP SE - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.versions.pom; | ||
|
||
public class PomVersionsUtil { | ||
|
||
/** | ||
* Returns whether the version is ci-friendy, i.e. is made up of one or more | ||
* <code>${properties}</code>. | ||
*/ | ||
public static boolean isCiFriendlyVersion(String version) { | ||
return version != null && version.contains("${"); | ||
} | ||
} |