-
Notifications
You must be signed in to change notification settings - Fork 191
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
assemble-repository: Prevent sources from being included inadvertently #3635
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>tycho-its-project.product.productRepository</groupId> | ||
<artifactId>product.product</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>eclipse-repository</packaging> | ||
|
||
<repositories> | ||
<repository> | ||
<id>e431</id> | ||
<layout>p2</layout> | ||
<!-- Important: This update site must have already been generated with the new P2 that adds the source as optional dependencyies with <filter>(org.eclipse.update.install.sources=true)</filter> metadata for the problem to show --> | ||
<url>https://download.eclipse.org/eclipse/updates/4.31/R-4.31-202402290520/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-maven-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<extensions>true</extensions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>target-platform-configuration</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<environments> | ||
<environment> | ||
<os>linux</os> | ||
<ws>gtk</ws> | ||
<arch>x86_64</arch> | ||
</environment> | ||
</environments> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-p2-repository-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<includeAllDependencies>true</includeAllDependencies> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-p2-director-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<executions> | ||
<execution> | ||
<id>materialize-products</id> | ||
<goals> | ||
<goal>materialize-products</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<products> | ||
<product> | ||
<id>product.product</id> | ||
</product> | ||
</products> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>withsources</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-p2-repository-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<includeAllSources>true</includeAllSources> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-p2-director-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<installSources>true</installSources> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
10 changes: 10 additions & 0 deletions
10
tycho-its/projects/product.productRepository/product.product
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?pde version="3.5"?> | ||
|
||
<product uid="product.product" id="product" application="application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="false"> | ||
|
||
<plugins> | ||
<plugin id="org.eclipse.osgi"/> | ||
</plugins> | ||
|
||
</product> |
54 changes: 54 additions & 0 deletions
54
tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductRepositoryTest.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,54 @@ | ||
/******************************************************************************* | ||
* 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 - [Issue #3522] product / repository contains source jars by default | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.test.product; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
|
||
import org.apache.maven.it.Verifier; | ||
import org.eclipse.tycho.test.AbstractTychoIntegrationTest; | ||
import org.junit.Test; | ||
|
||
public class ProductRepositoryTest extends AbstractTychoIntegrationTest { | ||
|
||
@Test | ||
public void testShouldNotContainSources() throws Exception { | ||
Verifier verifier = getVerifier("product.productRepository", false); | ||
verifier.executeGoals(Arrays.asList("clean", "verify")); | ||
verifier.verifyErrorFreeLog(); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/repository/plugins/org.eclipse.osgi_*.jar"); | ||
assertFileDoesNotExist(new File(verifier.getBasedir()), // | ||
"target/repository/plugins/org.eclipse.osgi.source_*.jar"); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/products/product.product/linux/gtk/x86_64/plugins/org.eclipse.osgi_*.jar"); | ||
assertFileDoesNotExist(new File(verifier.getBasedir()), // | ||
"target/products/product.product/linux/gtk/x86_64/plugins/org.eclipse.osgi.source_*.jar"); | ||
} | ||
|
||
@Test | ||
public void testShouldContainSourcesWhenExlicitlyIncluded() throws Exception { | ||
Verifier verifier = getVerifier("product.productRepository", false); | ||
verifier.addCliOption("-Pwithsources"); | ||
verifier.executeGoals(Arrays.asList("clean", "verify")); | ||
verifier.verifyErrorFreeLog(); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/repository/plugins/org.eclipse.osgi_*.jar"); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/repository/plugins/org.eclipse.osgi.source_*.jar"); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/products/product.product/linux/gtk/x86_64/plugins/org.eclipse.osgi_*.jar"); | ||
assertFileExists(new File(verifier.getBasedir()), // | ||
"target/products/product.product/linux/gtk/x86_64/plugins/org.eclipse.osgi.source_*.jar"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is actually the place where you want to filter things, this test if a requirement for a IU is applicable and you don't want the new requirement to be considered.