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

Fixed templates #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
49 changes: 29 additions & 20 deletions product.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby

# Copyright (c) 2013 to Jason van Zyl
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html

require 'mustache'
require 'rexml/document'
Expand Down Expand Up @@ -58,37 +58,46 @@

# Plugin
template = File.open('templates/plugin.mustache').read
plugin = Mustache.render(template, vars)
File.open(pluginId + "/plugin.xml", 'w') { |f|
f.write(plugin)
plugin = Mustache.render(template, vars)
File.open(pluginId + "/plugin.xml", 'w') { |f|
f.write(plugin)
}

# Feature
template = File.open('templates/feature.mustache').read
feature = Mustache.render(template, vars)
File.open(featureDirectory + "/feature.xml", 'w') { |f|
f.write(feature)
feature = Mustache.render(template, vars)
File.open(featureDirectory + "/feature.xml", 'w') { |f|
f.write(feature)
}

# Product
template = File.open('templates/product.mustache').read
product = Mustache.render(template, vars)
File.open("io.tesla.ide.rcp/io.tesla.ide.rcp.product", 'w') { |f|
f.write(product)
product = Mustache.render(template, vars)
File.open("io.tesla.ide.rcp/io.tesla.ide.rcp.product", 'w') { |f|
f.write(product)
}

# Poms
pomTemplate = File.open('templates/pom.parent.mustache').read
parentPom = Mustache.render(pomTemplate, vars)
File.open("pom.xml", 'w') { |f|
f.write(parentPom)
parentPom = Mustache.render(pomTemplate, vars)
File.open("pom.xml", 'w') { |f|
f.write(parentPom)
}

pomTemplate = File.open('templates/pom.product.mustache').read
productPom = Mustache.render(pomTemplate, vars)
File.open(productDirectory + "/pom.xml", 'w') { |f|
f.write(productPom)
productPom = Mustache.render(pomTemplate, vars)
File.open(productDirectory + "/pom.xml", 'w') { |f|
f.write(productPom)
}

pomTemplate = File.open('templates/pom.feature.mustache').read
featurePom = Mustache.render(pomTemplate, vars)
File.open(featureDirectory + "/pom.xml", 'w') { |f|
f.write(featurePom)
}


pomTemplate = File.open('templates/pom.plugin.mustache').read
pluginPom = Mustache.render(pomTemplate, vars)
File.open(pluginId + "/pom.xml", 'w') { |f|
f.write(pluginPom)
}
15 changes: 15 additions & 0 deletions templates/pom.feature.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<version>1.0.0-SNAPSHOT</version>
<groupId>org.sonatype.maven.ide</groupId>
<artifactId>maven-ide-parent</artifactId>
</parent>

<artifactId>io.tesla.ide.feature</artifactId>
<packaging>eclipse-feature</packaging>
<name>TeslaIDE :: Feature</name>
</project>