Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Bourque Bedard2018-07-15 20:26:15 -0400
committerGenevieve Bastien2018-07-15 21:07:14 -0400
commit34a392a8d2f8acb589a8ee1f1eb9ccdfddddf669 (patch)
treed35467b7e2da226a89de8bebffeb00291a704e29
parentd54b5c91bd6c0d170193c17ea09486b2b5f53e0a (diff)
downloadorg.eclipse.tracecompass.incubator-34a392a8d2f8acb589a8ee1f1eb9ccdfddddf669.tar.gz
org.eclipse.tracecompass.incubator-34a392a8d2f8acb589a8ee1f1eb9ccdfddddf669.tar.xz
org.eclipse.tracecompass.incubator-34a392a8d2f8acb589a8ee1f1eb9ccdfddddf669.zip
skeleton: add year parameter
This adds a --year parameter to the plugin creation script. It defaults to the system time year. Change-Id: Iaa9a13ad4dd9bdb4c670713240973695da08cdb1 Signed-off-by: Christophe Bourque Bedard <christophe.bourque.bedard@ericsson.com> Reviewed-on: https://git.eclipse.org/r/126082 Tested-by: CI Bot Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net> Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
-rwxr-xr-xskeleton/create_new_feature.py6
-rw-r--r--skeleton/pom.xml2
-rw-r--r--skeleton/skeleton.core.tests/build.properties2
-rw-r--r--skeleton/skeleton.core.tests/plugin.properties2
-rw-r--r--skeleton/skeleton.core.tests/src/ActivatorTest.java2
-rw-r--r--skeleton/skeleton.core/build.properties2
-rw-r--r--skeleton/skeleton.core/plugin.properties2
-rw-r--r--skeleton/skeleton.core/src/Activator.java2
-rw-r--r--skeleton/skeleton.core/src/package-info.java2
-rw-r--r--skeleton/skeleton.doc.user/build.properties2
-rw-r--r--skeleton/skeleton.doc.user/plugin.properties2
-rw-r--r--skeleton/skeleton.feature/build.properties2
-rw-r--r--skeleton/skeleton.feature/feature.properties2
-rw-r--r--skeleton/skeleton.ui.swtbot.tests/build.properties2
-rw-r--r--skeleton/skeleton.ui.swtbot.tests/plugin.properties2
-rw-r--r--skeleton/skeleton.ui/build.properties2
-rw-r--r--skeleton/skeleton.ui/plugin.properties2
-rw-r--r--skeleton/skeleton.ui/src/Activator.java2
-rw-r--r--skeleton/skeleton.ui/src/package-info.java2
19 files changed, 24 insertions, 18 deletions
diff --git a/skeleton/create_new_feature.py b/skeleton/create_new_feature.py
index 1563b0e5..fc5f5738 100755
--- a/skeleton/create_new_feature.py
+++ b/skeleton/create_new_feature.py
@@ -11,18 +11,22 @@
import argparse
import shutil
import os
+import time
parser = argparse.ArgumentParser(description='Creates the plugins and feature for a new incubator functionnality.')
parser.add_argument('name', help='The human readable name of the plugins and feature to add. The plugin names will the the dot-separated lowercase name. For example if name is "My Test Plugin", plugins will be named org.eclipse.tracecompass.incubator.my.test.plugin')
parser.add_argument('--dir', help='Directory in which to add the plugins')
parser.add_argument('--no-ui', dest='noUi', action='store_const', const=True, default=False, help='Whether to add a UI plugin for this feature')
parser.add_argument('--no-help', dest='noHelp', action='store_const', const=True, default=False, help='Whether to add an help plugin for this feature')
+parser.add_argument('--year', default=time.strftime("%Y"), help='The current year (defaults to current year from system time)')
parser.add_argument('--copyright', default="École Polytechnique de Montréal", help='The organisation that has the copyright on the new files')
args = parser.parse_args()
idPlaceholder = "{%skeleton}"
namePlaceholder = "{%skeletonName}"
+yearPlaceholder = "{%year}"
copyrightPlaceholder = "{%copyright}"
+year = args.year
copyright = args.copyright
baseDir = os.path.dirname(os.path.realpath(__file__))
@@ -53,6 +57,7 @@ def copyAndUpdate(srcDir, destDir, name, id):
s = f.read()
s = s.replace(idPlaceholder, id)
s = s.replace(namePlaceholder, name)
+ s = s.replace(yearPlaceholder, year)
s = s.replace(copyrightPlaceholder, copyright)
with open(fpath, encoding = "utf-8", mode = "w") as f:
f.write(s)
@@ -78,6 +83,7 @@ def updatePom(baseDir, destDir, id, moduleStr):
s = f.read();
s = s.replace("{%dir}", destDir)
s = s.replace(pomModulePlaceholder, moduleStr + pomModulePlaceholder)
+ s = s.replace(yearPlaceholder, year)
s = s.replace(copyrightPlaceholder, copyright)
with open(destPom, encoding = "utf-8", mode = 'w+') as f:
f.write(s)
diff --git a/skeleton/pom.xml b/skeleton/pom.xml
index 45273d1c..2274a677 100644
--- a/skeleton/pom.xml
+++ b/skeleton/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (C) 2017 {%copyright}
+ Copyright (C) {%year} {%copyright}
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.core.tests/build.properties b/skeleton/skeleton.core.tests/build.properties
index 19b31a51..4ea742cf 100644
--- a/skeleton/skeleton.core.tests/build.properties
+++ b/skeleton/skeleton.core.tests/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.core.tests/plugin.properties b/skeleton/skeleton.core.tests/plugin.properties
index 71bb0f34..6a4222bb 100644
--- a/skeleton/skeleton.core.tests/plugin.properties
+++ b/skeleton/skeleton.core.tests/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.core.tests/src/ActivatorTest.java b/skeleton/skeleton.core.tests/src/ActivatorTest.java
index fa59641d..ef75a08d 100644
--- a/skeleton/skeleton.core.tests/src/ActivatorTest.java
+++ b/skeleton/skeleton.core.tests/src/ActivatorTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 {%copyright}
+ * Copyright (c) {%year} {%copyright}
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
diff --git a/skeleton/skeleton.core/build.properties b/skeleton/skeleton.core/build.properties
index b2b78f7a..407f8fdc 100644
--- a/skeleton/skeleton.core/build.properties
+++ b/skeleton/skeleton.core/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.core/plugin.properties b/skeleton/skeleton.core/plugin.properties
index f5c290e0..c8660620 100644
--- a/skeleton/skeleton.core/plugin.properties
+++ b/skeleton/skeleton.core/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.core/src/Activator.java b/skeleton/skeleton.core/src/Activator.java
index 19c13aa5..1c3fa634 100644
--- a/skeleton/skeleton.core/src/Activator.java
+++ b/skeleton/skeleton.core/src/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 {%copyright}
+ * Copyright (c) {%year} {%copyright}
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
diff --git a/skeleton/skeleton.core/src/package-info.java b/skeleton/skeleton.core/src/package-info.java
index 7c4be17a..ff35acb3 100644
--- a/skeleton/skeleton.core/src/package-info.java
+++ b/skeleton/skeleton.core/src/package-info.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 {%copyright}
+ * Copyright (c) {%year} {%copyright}
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
diff --git a/skeleton/skeleton.doc.user/build.properties b/skeleton/skeleton.doc.user/build.properties
index bc085bfa..025848fa 100644
--- a/skeleton/skeleton.doc.user/build.properties
+++ b/skeleton/skeleton.doc.user/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2017 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.doc.user/plugin.properties b/skeleton/skeleton.doc.user/plugin.properties
index 594e5f7e..afa4d68c 100644
--- a/skeleton/skeleton.doc.user/plugin.properties
+++ b/skeleton/skeleton.doc.user/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2017 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.feature/build.properties b/skeleton/skeleton.feature/build.properties
index 52b2dcd7..7e5b5e81 100644
--- a/skeleton/skeleton.feature/build.properties
+++ b/skeleton/skeleton.feature/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.feature/feature.properties b/skeleton/skeleton.feature/feature.properties
index 0c37c170..c5a883e6 100644
--- a/skeleton/skeleton.feature/feature.properties
+++ b/skeleton/skeleton.feature/feature.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.ui.swtbot.tests/build.properties b/skeleton/skeleton.ui.swtbot.tests/build.properties
index 19b31a51..4ea742cf 100644
--- a/skeleton/skeleton.ui.swtbot.tests/build.properties
+++ b/skeleton/skeleton.ui.swtbot.tests/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.ui.swtbot.tests/plugin.properties b/skeleton/skeleton.ui.swtbot.tests/plugin.properties
index 5d2808ae..0ad064d7 100644
--- a/skeleton/skeleton.ui.swtbot.tests/plugin.properties
+++ b/skeleton/skeleton.ui.swtbot.tests/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.ui/build.properties b/skeleton/skeleton.ui/build.properties
index 19b31a51..4ea742cf 100644
--- a/skeleton/skeleton.ui/build.properties
+++ b/skeleton/skeleton.ui/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.ui/plugin.properties b/skeleton/skeleton.ui/plugin.properties
index 5d2808ae..0ad064d7 100644
--- a/skeleton/skeleton.ui/plugin.properties
+++ b/skeleton/skeleton.ui/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2018 {%copyright}
+# Copyright (c) {%year} {%copyright}
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
diff --git a/skeleton/skeleton.ui/src/Activator.java b/skeleton/skeleton.ui/src/Activator.java
index 9f452e0c..e18d561a 100644
--- a/skeleton/skeleton.ui/src/Activator.java
+++ b/skeleton/skeleton.ui/src/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 {%copyright}
+ * Copyright (c) {%year} {%copyright}
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
diff --git a/skeleton/skeleton.ui/src/package-info.java b/skeleton/skeleton.ui/src/package-info.java
index 7464d2b8..d47c5eaf 100644
--- a/skeleton/skeleton.ui/src/package-info.java
+++ b/skeleton/skeleton.ui/src/package-info.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 {%copyright}
+ * Copyright (c) {%year} {%copyright}
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which

Back to the top