| /** |
| * ******************************************************************************* |
| * Copyright (c) 2020 Robert Bosch GmbH. |
| * |
| * 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: |
| * Robert Bosch GmbH - initial API and implementation |
| * ******************************************************************************* |
| */ |
| |
| package org.eclipse.app4mc.slg.commons.m2t.transformers |
| |
| import com.google.inject.Inject |
| import com.google.inject.Singleton |
| import java.util.ArrayList |
| import java.util.HashMap |
| import org.eclipse.app4mc.amalthea.model.Label |
| import org.eclipse.app4mc.slg.commons.m2t.generators.LabelTranslationUnit |
| import org.eclipse.app4mc.transformation.util.OutputBuffer |
| |
| @Singleton |
| class LabelTransformer extends SynteticTransformer<LabelTranslationUnit> { |
| |
| @Inject OutputBuffer outputBuffer |
| |
| def create new LabelTranslationUnit(outputBuffer, label) |
| transform(Label label) { |
| } |
| |
| override HashMap<ArrayList<?>, LabelTranslationUnit> getCache() { return this._createCache_transform } |
| |
| def createCMake() { |
| outputBuffer.appendTo("OTHER", LabelTranslationUnit.makeFilePathStatic, toCMake()) |
| } |
| |
| def String toCMake() ''' |
| # «LabelTranslationUnit.libName» ################################################################ |
| #### |
| add_library(«LabelTranslationUnit.libName» STATIC |
| «FOR srcFile : getSrcFiles()» |
| ${CMAKE_CURRENT_LIST_DIR}/_src/«srcFile» |
| «ENDFOR» |
| ) |
| |
| target_include_directories(«LabelTranslationUnit.getLibName()» |
| PUBLIC ${CMAKE_CURRENT_LIST_DIR}/_inc |
| ) |
| ''' |
| } |