update templates

This commit is contained in:
Eyck Jentzsch 2022-02-13 22:12:40 +01:00
parent a78566675e
commit dae876ff84
5 changed files with 211 additions and 34 deletions

View File

@ -0,0 +1,104 @@
<?xml version="1.0"?>
<project name="project">
<target name="getMajorMinorVersion">
<script language="javascript">
<![CDATA[
// getting the value
buildnumber = project.getProperty("unqualifiedVersion");
index = buildnumber.lastIndexOf(".");
counter = buildnumber.substring(0, index);
project.setProperty("majorMinorVersion",counter);
]]>
</script>
</target>
<target name="test_getMajorMinor" depends="getMajorMinorVersion">
<echo message="majorMinorVersion: ${majorMinorVersion}"/>
</target>
<!--
site.label The name/title/label of the created composite site
unqualifiedVersion The version without any qualifier replacement
buildQualifier The build qualifier
-->
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
<property name="full.version" value="${unqualifiedVersion}" />
<property name="software.download.area" location="${user.home}/p2.repositories" />
<property name="updates.dir" value="updates" />
<property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
<property name="main.site.composite.name" value="${site.label} All Versions" />
<!--
<property name="main.composite.repository.directory" location="${software.download.area}/${updates.dir}" />
-->
<property name="main.composite.repository.directory" location="${software.download.area}" />
<property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
<property name="child.repository" value="${full.version}" />
<property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
</target>
<target name="p2.composite.add" depends="compute.child.repository.data">
<property name="source.repository" location="${project.build.directory}/repository"/>
<echo message=" " />
<echo message="Source repository path: ${source.repository}" />
<echo message="Copying to ${child.repository.directory}..." />
<mkdir dir="${child.repository.directory}"/>
<copy todir="${child.repository.directory}" overwrite="true">
<fileset dir="${source.repository}" />
</copy>
<add.composite.repository.internal
composite.repository.location="${composite.repository.directory}"
composite.repository.name="${site.composite.name}"
composite.repository.child="${child.repository}"
/>
<add.composite.repository.internal
composite.repository.location="${main.composite.repository.directory}"
composite.repository.name="${main.site.composite.name}"
composite.repository.child="${majorMinorVersion}"
/>
</target>
<!-- = = = = = = = = = = = = = = = = =
macrodef: add.composite.repository.internal
= = = = = = = = = = = = = = = = = -->
<macrodef name="add.composite.repository.internal">
<attribute name="composite.repository.location" />
<attribute name="composite.repository.name" />
<attribute name="composite.repository.child" />
<sequential>
<echo message=" " />
<echo message="Composite repository : @{composite.repository.location}" />
<echo message="Composite name : @{composite.repository.name}" />
<echo message="Adding child repository : @{composite.repository.child}" />
<p2.composite.repository>
<repository compressed="false" location="@{composite.repository.location}" name="@{composite.repository.name}" />
<add>
<repository location="@{composite.repository.child}" />
</add>
</p2.composite.repository>
<echo file="@{composite.repository.location}/p2.index">version=1
metadata.repository.factory.order=compositeContent.xml,\!
artifact.repository.factory.order=compositeArtifacts.xml,\!
</echo>
</sequential>
</macrodef>
</project>

View File

@ -47,6 +47,96 @@
</pluginManagement> </pluginManagement>
</build> </build>
<profiles>
<profile>
<!-- Activate this profile to perform the release to Bintray -->
<id>release-composite</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>bash</executable>
<!-- optional -->
<workingDirectory>${software.download.area}</workingDirectory>
<arguments>
<argument>-c</argument>
<argument>if [ -d RDL-Editor-GHP ]; then cd RDL-Editor-GHP; git pull; else git clone -v --branch gh-pages https://github.com/Minres/RDL-Editor.git RDL-Editor-GHP; fi</argument>
</arguments>
<environmentVariables>
<LANG>en_US</LANG>
</environmentVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<!-- IMPORTANT: DO NOT split the arg line -->
<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile packaging-p2-composite.ant p2.composite.add -Dsite.label="RDL-Editor Software Repository" -Dproject.build.directory=${project.build.directory} -DunqualifiedVersion=${unqualifiedVersion} -Dsoftware.download.area="${software.download.area}/RDL-Editor-GHP/repository"</appArgLine>
<repositories>
<repository>
<id>2021-03</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/2021-03/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<artifactId>org.eclipse.ant.core</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.apache.ant</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.repository.tools</artifactId>
<type>eclipse-plugin</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
<dependency>
<artifactId>org.eclipse.equinox.ds</artifactId>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
</configuration>
<executions>
<execution>
<id>add-p2-composite-repository</id>
<phase>package</phase>
<goals>
<goal>eclipse-run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies> <dependencies>
</dependencies> </dependencies>
</project> </project>

View File

@ -26,6 +26,12 @@ class ModuleGenerator extends RdlBaseGenerator {
.filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0] .filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0]
if(addrMaps.size==0) return '' if(addrMaps.size==0) return ''
''' '''
/*
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_ #ifndef _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_
#define _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_ #define _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_
#include <scc/tlm_target.h> #include <scc/tlm_target.h>

View File

@ -22,40 +22,15 @@ class RegfileGenerator extends RdlBaseGenerator{
} }
override String generateHeader(String namespace)''' override String generateHeader(String namespace)'''
//////////////////////////////////////////////////////////////////////////////// /*
// Copyright (C) 2017-2022, MINRES Technologies GmbH * Copyright (c) 2019 -2022 MINRES Technologies GmbH
// All rights reserved. *
// * SPDX-License-Identifier: Apache-2.0
// Redistribution and use in source and binary forms, with or without *
// modification, are permitted provided that the following conditions are met: * Created on: «new Date»
// * * «componentDefinition.effectiveName».h Author: <RDL Generator>
// 1. Redistributions of source code must retain the above copyright notice, *
// this list of conditions and the following disclaimer. */
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Created on: «new Date»
// * «componentDefinition.effectiveName».h Author: <RDL Generator>
//
////////////////////////////////////////////////////////////////////////////////
#ifndef _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_ #ifndef _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_
#define _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_ #define _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_

View File

@ -20,6 +20,8 @@
<systemProperties></systemProperties> <systemProperties></systemProperties>
<additionalTestArguments></additionalTestArguments> <additionalTestArguments></additionalTestArguments>
<rdl-plugin.version>1.3.0-SNAPSHOT</rdl-plugin.version> <rdl-plugin.version>1.3.0-SNAPSHOT</rdl-plugin.version>
<software.download.area>${project.basedir}/../../..</software.download.area>
</properties> </properties>
<modules> <modules>
<module>com.minres.rdl</module> <module>com.minres.rdl</module>