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

Bug 564018 - [Passage] update baseline to point to 0.9.0 #238

Merged
merged 11 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@ jobs:
java-version: 1.8
- name: Setup Maven
run: echo "MAVEN_OPTS='-Xmx2048m'" > ~/.mavenrc
- name: Cache maven repo
uses: actions/cache@v2
env:
cache-name: cache-maven-repo
with:
# maven files are stored in `~/.m2/repository` on Linux/macOS
path: ~/.m2/repository
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.sha1') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build with Maven
run: mvn clean verify -U -Pcoverage
run: mvn clean verify --no-transfer-progress -U -Pcoverage
- name: Publish coverage
run: bash <(curl -s https://codecov.io/bash)
5 changes: 2 additions & 3 deletions bundles/org.eclipse.passage.lic.mail/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.mail
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.mail
Bundle-Version: 0.1.0.qualifier
Bundle-Version: 0.2.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: javax.activation;bundle-version="0.0.0",
javax.mail;bundle-version="0.0.0",
Require-Bundle: javax.mail;bundle-version="0.0.0",
org.eclipse.osgi.services;bundle-version="0.0.0",
org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.passage.lic.email;bundle-version="0.0.0";visibility:=reexport
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.passage.lic.internal.mail.MailImpl">
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" name="org.eclipse.passage.lic.internal.mail.MailImpl">
<service>
<provide interface="org.eclipse.passage.lic.email.Mailing"/>
</service>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.function.BiConsumer;

import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.activation.CommandMap;
import javax.activation.MailcapCommandMap;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Part;
import javax.mail.Session;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
Expand All @@ -32,6 +34,7 @@

import org.eclipse.passage.lic.email.EmailDescriptor;
import org.eclipse.passage.lic.email.Mailing;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;

/**
Expand All @@ -42,6 +45,17 @@
*/
@Component
public class MailImpl implements Mailing {

@Activate
public void activate() {
//it **may** work "out-of-the-box", but let's declare explicitly to know where to dig
MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
mc.addMailcap("text/plain;; x-java-content-handler=org.apache.geronimo.mail.handlers.TextHandler");
mc.addMailcap("text/xml;; x-java-content-handler=org.apache.geronimo.mail.handlers.XMLHandler");
mc.addMailcap("text/html;; x-java-content-handler=org.apache.geronimo.mail.handlers.HtmlHandler");
mc.addMailcap("message/rfc822;; x-java-content-handler=org.apache.geronimo.mail.handlers.MessageHandler");
mc.addMailcap("multipart/*;; x-java-content-handler=org.apache.geronimo.mail.handlers.MultipartHandler; x-java-fallback-entry=true");
}

@Override
public void writeEml(EmailDescriptor descriptor, OutputStream output, BiConsumer<String, Throwable> consumerStatus) {
Expand All @@ -62,27 +76,29 @@ private Message createMessage(EmailDescriptor descriptor) throws MessagingExcept
return message;
}

private void fulfillMessage(EmailDescriptor descriptor, Message message) throws MessagingException {
private void fulfillMessage(EmailDescriptor descriptor, Message message) throws MessagingException, IOException {
Multipart multipart = createBody(descriptor.getBody());
attachFiles(descriptor, multipart);
message.setContent(multipart);
}

private Multipart createBody(String body) throws MessagingException {
Multipart multipart = new MimeMultipart("mixed"); //$NON-NLS-1$
MimeBodyPart content = new MimeBodyPart();
content.setText(body);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(content);
content.setText(body, "UTF-8");
return multipart;
}

private void attachFiles(EmailDescriptor descriptor, Multipart multipart) throws MessagingException {
private void attachFiles(EmailDescriptor descriptor, Multipart multipart) throws MessagingException, IOException {
Iterable<String> attachmentPaths = descriptor.getAttachmentPaths();
for (String path : attachmentPaths) {
final File attache = new File(path);
MimeBodyPart attachment = new MimeBodyPart();
DataSource source = new FileDataSource(attache);
attachment.setDataHandler(new DataHandler(source));
//FIXME: we need to support content types near to attachment path
attachment.setContent(Files.readAllBytes(Paths.get(path)), "application/binary");
attachment.addHeader("Content-Transfer-Encoding", "base64");
attachment.setDisposition(Part.ATTACHMENT);
attachment.setFileName(attache.getName());
multipart.addBodyPart(attachment);
}
Expand Down
2 changes: 1 addition & 1 deletion features/org.eclipse.passage.lic.mail.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<feature
id="org.eclipse.passage.lic.mail.feature"
label="%featureName"
version="0.1.100.qualifier"
version="0.2.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
29 changes: 19 additions & 10 deletions releng/org.eclipse.passage.releng/passage.setup
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
xmlns:setup.targlets="http://www.eclipse.org/oomph/setup/targlets/1.0"
xmlns:setup.workingsets="http://www.eclipse.org/oomph/setup/workingsets/1.0"
xmlns:workingsets="http://www.eclipse.org/oomph/workingsets/1.0"
xsi:schemaLocation="http://www.eclipse.org/oomph/setup/git/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Git.ecore http://www.eclipse.org/oomph/setup/jdt/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/setup/mylyn/1.0 index:/models/Mylyn.ecore http://www.eclipse.org/oomph/setup/pde/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/PDE.ecore http://www.eclipse.org/oomph/predicates/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/projects/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Projects.ecore http://www.eclipse.org/oomph/setup/targlets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupTarglets.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore http://www.eclipse.org/oomph/workingsets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore"
xsi:schemaLocation="http://www.eclipse.org/oomph/setup/git/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Git.ecore http://www.eclipse.org/oomph/setup/jdt/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/JDT.ecore http://www.eclipse.org/oomph/setup/mylyn/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Mylyn.ecore http://www.eclipse.org/oomph/setup/pde/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/PDE.ecore http://www.eclipse.org/oomph/predicates/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore http://www.eclipse.org/oomph/setup/projects/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Projects.ecore http://www.eclipse.org/oomph/setup/targlets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupTarglets.ecore http://www.eclipse.org/oomph/setup/workingsets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/SetupWorkingSets.ecore http://www.eclipse.org/oomph/workingsets/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/WorkingSets.ecore"
name="passage"
label="Passage">
<annotation
Expand Down Expand Up @@ -58,7 +58,7 @@
<setupTask
xsi:type="setup:VariableTask"
name="eclipse.target.platform"
value="2020-03"
value="2020-06"
storageURI="scope://Workspace"/>
<setupTask
xsi:type="setup.p2:P2Task"
Expand All @@ -74,7 +74,7 @@
<repository
url="https://download.eclipse.org/modeling/emf/emf/builds/nightly/latest"/>
<repository
url="https://download.eclipse.org/releases/2020-03/"/>
url="https://download.eclipse.org/releases/2020-06/"/>
<repository
url="https://repo1.maven.org/maven2/.m2e/connectors/m2eclipse-tycho/0.9.0/N/LATEST/"/>
<description>Install the tools needed in the IDE to work with the source code for ${scope.project.label}</description>
Expand Down Expand Up @@ -146,17 +146,17 @@
<repositoryList
name="Passage Latest Released">
<repository
url="https://download.eclipse.org/releases/2020-03/"/>
url="https://download.eclipse.org/releases/2020-06/"/>
<repository
url="https://download.eclipse.org/tools/orbit/downloads/2020-03"/>
url="https://download.eclipse.org/tools/orbit/downloads/2020-06"/>
<repository
url="https://download.eclipse.org/passage/updates/release/0.8.0/lic/"/>
url="https://download.eclipse.org/passage/updates/release/0.9.0/lic/"/>
<repository
url="https://download.eclipse.org/passage/updates/release/0.8.0/loc/"/>
url="https://download.eclipse.org/passage/updates/release/0.9.0/loc/"/>
<repository
url="https://download.eclipse.org/passage/updates/release/0.8.0/lbc/"/>
url="https://download.eclipse.org/passage/updates/release/0.9.0/lbc/"/>
<repository
url="https://download.eclipse.org/passage/updates/release/0.8.0/ldc/"/>
url="https://download.eclipse.org/passage/updates/release/0.9.0/ldc/"/>
</repositoryList>
</targlet>
</setupTask>
Expand Down Expand Up @@ -192,7 +192,7 @@
xsi:type="setup.targlets:TargletTask">
<targlet
name="${scope.project.label}"
activeRepositoryList="2020-03">
activeRepositoryList="2020-06">
<requirement
name="com.fasterxml.jackson.core.jackson-annotations"/>
<requirement
Expand Down Expand Up @@ -237,6 +237,15 @@
<sourceLocator
rootFolder="${git.clone.passage.location}"
locateNestedProjects="true"/>
<repositoryList
name="2020-06">
<repository
url="https://download.eclipse.org/cbi/updates/license/"/>
<repository
url="https://download.eclipse.org/releases/2020-06/"/>
<repository
url="https://download.eclipse.org/tools/orbit/downloads/2020-06"/>
</repositoryList>
<repositoryList
name="2020-03">
<repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@
Contributors:
ArSysOp - initial API and implementation
-->
<target name="org.eclipse.passage.baseline" sequenceNumber="85">
<target name="org.eclipse.passage.baseline" sequenceNumber="86">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.license.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/cbi/updates/license/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.passage.lbc.execute.feature.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.8.0/lbc/"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.9.0/lbc/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.passage.ldc.feature.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.8.0/ldc/"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.9.0/ldc/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.passage.lic.define.feature.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.8.0/lic/"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.9.0/lic/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.passage.loc.operator.feature.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.8.0/loc/"/>
<repository location="https://download.eclipse.org/passage/updates/release/0.9.0/loc/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.ecp.sdk.feature.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2020-03/"/>
<repository location="https://download.eclipse.org/releases/2020-06/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="0.0.0"/>
Expand Down Expand Up @@ -68,7 +68,7 @@
<unit id="org.mockito" version="0.0.0"/>
<unit id="org.slf4j.api" version="0.0.0"/>
<unit id="org.slf4j.api.source" version="0.0.0"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/2020-03/"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/2020-06/"/>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Contributors:
ArSysOp - initial API and implementation
-->
<target name="org.eclipse.passage.target" sequenceNumber="85">
<target name="org.eclipse.passage.target" sequenceNumber="86">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.license.feature.group" version="0.0.0"/>
Expand All @@ -24,7 +24,7 @@
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2020-03/"/>
<repository location="https://download.eclipse.org/releases/2020-06/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="0.0.0"/>
Expand Down Expand Up @@ -52,7 +52,7 @@
<unit id="org.mockito" version="0.0.0"/>
<unit id="org.slf4j.api" version="0.0.0"/>
<unit id="org.slf4j.api.source" version="0.0.0"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/2020-03/"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/2020-06/"/>
</location>
</locations>
</target>
18 changes: 7 additions & 11 deletions tests/org.eclipse.passage.lic.mail.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.mail.tests
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.mail.tests
Bundle-Version: 0.2.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-SymbolicName: org.eclipse.passage.lic.mail.tests;singleton:=true
Bundle-Version: 0.1.0.qualifier
Automatic-Module-Name: org.eclipse.passage.lic.mail.tests
Fragment-Host: org.eclipse.passage.lic.mail
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit;bundle-version="4.12.0",
javax.mail;bundle-version="0.0.0",
org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.equinox.registry;bundle-version="3.8.200",
org.eclipse.equinox.common;bundle-version="0.0.0",
org.eclipse.passage.lic.equinox;bundle-version="0.5.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0",
org.eclipse.passage.lic.mail;bundle-version="0.1.0"
Require-Bundle: org.junit;bundle-version="4.12.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.passage.lic.mail.tests
Import-Package: javax.activation;version="1.1.0",
javax.mail;version="1.4.0"
Loading