Skip to content

Commit

Permalink
reproduced #2983
Browse files Browse the repository at this point in the history
  • Loading branch information
ivumwd committed Mar 1, 2024
1 parent 6b4ab4c commit 5319141
Show file tree
Hide file tree
Showing 12 changed files with 276 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###############################################################################
# Copyright (c) 2010, 2011 SAP AG and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# SAP AG - initial API and implementation
###############################################################################
bin.includes = feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="helloworld.feature"
label="OSGi Hello World Feature"
version="0.1.0.qualifier">

<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>

<license url="http://www.example.com/license">
[Enter License Description here.]
</license>

<plugin
id="helloworld"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="helloworld.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>helloworld.feature</artifactId>
<packaging>eclipse-feature</packaging>

<parent>
<artifactId>helloworld.parent</artifactId>
<groupId>helloworld</groupId>
<version>0.1.0-SNAPSHOT</version>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/helloworld.feature_0.0.0.jar" id="helloworld.feature" version="0.0.0"/>
<feature url="features/io.spring.javaformat.eclipse.feature_0.0.0.jar" id="io.spring.javaformat.eclipse.feature" version="0.0.0"/>
</site>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>helloworld.updatesite</artifactId>
<packaging>eclipse-repository</packaging>

<parent>
<artifactId>helloworld.parent</artifactId>
<groupId>helloworld</groupId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<repositories>
<repository>
<id>eclipse-indigo</id>
<url>https://download.eclipse.org/releases/2024-03</url>
<layout>p2</layout>
</repository>
</repositories>


<dependencies>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>io.spring.javaformat.eclipse.feature</artifactId>
<version>0.0.41</version>
</dependency>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>io.spring.javaformat.eclipse.feature</artifactId>
<version>0.0.41</version>
<classifier>p2metadata</classifier>
<type>xml</type>
</dependency>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>io.spring.javaformat.eclipse.feature</artifactId>
<version>0.0.41</version>
<classifier>p2artifacts</classifier>
<type>xml</type>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: helloworld
Bundle-Version: 0.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %pluginVendor
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
###############################################################################
# Copyright (c) 2010, 2011 SAP AG and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# SAP AG - initial API and implementation
###############################################################################
source.. = src/
output.. = target/classes
bin.includes = META-INF/,\
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pluginName=Hello Plugin
pluginVendor=Hello Vendor
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>helloworld</artifactId>
<packaging>eclipse-plugin</packaging>

<parent>
<artifactId>helloworld.parent</artifactId>
<groupId>helloworld</groupId>
<version>0.1.0-SNAPSHOT</version>
</parent>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2010, 2011 SAP AG 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 AG - initial API and implementation
*******************************************************************************/
package helloworld;

public class MessageProvider {

public String getGreeting() {
return getGreeting("World");
}

public String getGreeting(String receiver) {
return "Hello " + receiver + "!!";
}

}
58 changes: 58 additions & 0 deletions tycho-its/projects/TYCHO2983siteWithPubishedFeatures/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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>helloworld</groupId>
<artifactId>helloworld.parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>helloworld</module>
<module>helloworld.feature</module>
<module>helloworld.updatesite</module>
</modules>

<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>
<resolver>p2</resolver>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<archiveSite>true</archiveSite>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>plugin-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) 2010, 2023 SAP AG 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:
* - initial API and implementation
*******************************************************************************/

package org.eclipse.tycho.test.TYCHO2983siteWithPubishedFeatures;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.TychoConstants;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.XMLTool;
import org.junit.Test;

import java.io.File;
import java.util.Arrays;

import static org.junit.Assert.*;

public class TYCHO2983siteWithPubishedFeatures extends AbstractTychoIntegrationTest {

@Test
public void testCheckSiteFeatures() throws Exception {
Verifier verifier = getVerifier("/TYCHO2983siteWithPubishedFeatures", false);
verifier.executeGoal("verify");
verifier.verifyErrorFreeLog();

File siteFeaturesFolder = new File(verifier.getBasedir(), "helloworld.updatesite/target/repository/features");

assertTrue(siteFeaturesFolder.exists());
assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter(
file -> file.getName().startsWith("helloworld.feature"))
.findAny()
.orElse(null)
);
assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter(
file -> file.getName().startsWith("io.spring.javaformat.eclipse.feature"))
.findAny()
.orElse(null)
);
}
}

0 comments on commit 5319141

Please sign in to comment.