Skip to content

Commit

Permalink
#11306 generate and publish TS DTO interfaces
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
  • Loading branch information
evidolob committed Dec 27, 2018
1 parent c6972d4 commit b3e4758
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<module>assembly</module>
<module>selenium</module>
<module>dockerfiles</module>
<module>typescript-dto</module>
</modules>
<scm>
<connection>scm:git:git@github.com:eclipse/che.git</connection>
Expand Down
1 change: 1 addition & 0 deletions typescript-dto/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.d.ts
35 changes: 35 additions & 0 deletions typescript-dto/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2018 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation

###
# Builder Image
#
#FROM maven:3.3-jdk-8 as builder

#ADD ./dto-pom.xml /generator/pom.xml

#RUN cd /generator && mvn -U -DskipTests=true -Dfindbugs.skip=true -Dskip-validate-sources install

###
# Publish image
#
FROM node:6.11.2

RUN npm i -g yarn@1.9.4

ADD package.json /che/package.json

COPY ./index.d.ts /che/index.d.ts

ARG NPM_AUTH_TOKEN

ARG CHE_VERSION

RUN cd /che && yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version ${CHE_VERSION}
112 changes: 112 additions & 0 deletions typescript-dto/dto-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2012-2017 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc.- initial API and implementation
-->
<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>
<parent>
<artifactId>maven-depmgt-pom</artifactId>
<groupId>org.eclipse.che.depmgt</groupId>
<version>6.17.0-SNAPSHOT</version>
</parent>
<artifactId>dts-dto-typescript</artifactId>
<packaging>pom</packaging>
<name>Che TypeScript DTO</name>
<properties>
<che.version>6.17.0-SNAPSHOT</che.version>
</properties>
<repositories>
<repository>
<id>ossrh</id>
<name>central public releases</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
</repository>
<repository>
<id>ossrh-snapshots</id>
<name>central public snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>codenvy-public-repo</id>
<name>ossrh releases</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
</pluginRepository>
<pluginRepository>
<id>ossrh-snapshots</id>
<name>ossrh snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-typescript-dto-maven-plugin</artifactId>
<version>${che.version}</version>
<executions>
<execution>
<configuration>
<dts>true</dts>
</configuration>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-factory-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-project-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-project-templates-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-ssh-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-system-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-user-shared</artifactId>
<version>${che.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-workspace-shared</artifactId>
<version>${che.version}</version>
</dependency>
</dependencies>
<configuration>
<inherited>false</inherited>
</configuration>
</plugin>
</plugins>
</build>
</project>
7 changes: 7 additions & 0 deletions typescript-dto/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@eclipse-che/api",
"version": "6.16.0",
"description": "Eclipse Che DTO API",
"types": "index.d.ts",
"license": "EPL-2.0"
}
96 changes: 96 additions & 0 deletions typescript-dto/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018-2018 Red Hat, Inc.
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
Contributors:
Red Hat, Inc. - initial API and implementation
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>6.16.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.che.typescript.dto</groupId>
<artifactId>che-typescript-dto</artifactId>
<packaging>pom</packaging>
<name>Che TypeScript DTO Generate and Publish</name>
<inceptionYear>2018</inceptionYear>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}</directory>
<includes>
<include>index.d.ts</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>codenvy-release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-dts</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<exec executable="bash" failonerror="true">
<arg value="-c" />
<arg value="docker run -i --rm -v &quot;$HOME/.m2:/root/.m2&quot; -v &quot;${basedir}/dto-pom.xml:/usr/src/mymaven/pom.xml&quot; -w /usr/src/mymaven maven:3.3-jdk-8 /bin/bash -c &quot;mvn -q -U -DskipTests=true -Dfindbugs.skip=true -Dskip-validate-sources install &amp;&amp; cat target/dts-dto-typescript.d.ts&quot; >> index.d.ts" />
</exec>
</target>
</configuration>
</execution>
<execution>
<id>build-image</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- build workspace loader with maven in docker -->
<exec dir="${basedir}" executable="docker" failonerror="true">
<arg value="build" />
<arg value="-t" />
<arg value="eclipse-che-ts-api" />
<arg value="--build-arg" />
<arg value="CHE_VERSION=${che.version}" />
<arg value="--build-arg" />
<arg value="NPM_AUTH_TOKEN=${NPM_AUTH_TOKEN}" />
<arg value="." />
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit b3e4758

Please sign in to comment.