Skip to content

Instantly share code, notes, and snippets.

View pcdavid's full-sized avatar

Pierre-Charles David pcdavid

View GitHub Profile
        <repository>
            <id>repo.eclipse.org</id>
            <name>EMF Services Repository - Snapshots</name>
            <url>https://repo.eclipse.org/content/repositories/emfservices-snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository
@pcdavid
pcdavid / pom.xml
Created November 29, 2023 12:48
tycho-mirror
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.pcdavid</groupId>
<artifactId>tycho-mirrors</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
{
"id": "4",
"type": "start",
"payload": {
"variables": {
"input": {
"id": "adb4bbaa-9a7d-410c-9e16-6a6c388bf94c",
"editingContextId": "5a53503c-cdea-446c-852a-0fade12e5778",
"formDescriptionEditorId": "c7431881-7c7f-4458-bcb1-ee16b5b43ad0"
}
@pcdavid
pcdavid / ExtractVSMExpressions.java
Last active June 17, 2023 15:07
Extract all AQL expressions from a Sirius Desktop VSM
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.IOException;
import java.nio.file.Path;
import java.util.HashSet;
#!/bin/bash
export USER=pdavid
export SERVER=git.eclipse.org
export PROJECT_SHORT=sirius
export PROJECT_FULL=sirius/org.eclipse.sirius
ssh -p 29418 "$USER@$SERVER" gerrit query --format JSON --current-patch-set --no-limit status:open "project:$PROJECT_FULL" | \
tee -a "~/${PROJECT_SHORT}-open-changes.json" | \
jq -r '. | select(has("number")) | ("git fetch ssh://[email protected]:29418/sirius/org.eclipse.sirius " + .currentPatchSet.ref + " && git branch change/" + (.number | tostring) + "/" + (.currentPatchSet.number | tostring) + " FETCH_HEAD")' | \
public class Props {
public static void main(String[] args) {
System.getProperties().forEach((k, v) -> System.out.println(k + ": " + v));
}
}
@pcdavid
pcdavid / pr_reject_eca.md
Last active November 23, 2020 20:09
Standard replies for Sirius Web

Thanks for the feedback and contribution.

Unfortunately, as an official Eclipse project we have to follow very strict rules about accepting external contributions. Even if we are now on GitHub where people can more easily create PRs, those can only be accepted if they are from people who have signed the Eclipse Contributor Agreement (ECA). That is the meaning of the failed check above.

@pcdavid
pcdavid / README.md
Last active September 7, 2020 08:38
VS Code configuration to enable live debugging from Chromium
  1. Make sure you have the "Debugger for Chrome" VS Code extension installed.
  2. Put this file in the .vscode folder at the root of the create-react-app project.
  3. Adjust the path to the Chrome/Chromium binary if needed.
  4. Launch the app normally with npm run start.
  5. Start debugging in VS Code with F5.

See:

#!/bin/sh
readonly PLATFORM="${1:-2019-06}"
readonly SUITE="${2:-junit}"
#SUITE="swtbot-sequence"
#SUITE="swtbot"
readonly COMMIT="$(git describe)"
readonly NAME="sirius-tests_${COMMIT}_${SUITE}"
readonly IMAGE="eclipsesirius/build:1.1"
readonly TARGET="$HOME/tmp/$NAME"
// From capella/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CapellaResourceHelper.java
/**
* Returns whether the given project is a Capella project (project or library)
*/
public static boolean isCapellaProject(IProject targetProject) {
try {
return targetProject.hasNature(CAPELLA_PROJECT_NATURE) || targetProject.hasNature(CAPELLA_LIBRARY_PROJECT_NATURE);
} catch (CoreException exception) {
return false;