summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.sdk.ide
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.yocto.sdk.ide')
-rw-r--r--plugins/org.yocto.sdk.ide/.classpath7
-rw-r--r--plugins/org.yocto.sdk.ide/.project32
-rw-r--r--plugins/org.yocto.sdk.ide/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/org.yocto.sdk.ide/META-INF/MANIFEST.MF37
-rw-r--r--plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties16
-rw-r--r--plugins/org.yocto.sdk.ide/build.properties9
-rw-r--r--plugins/org.yocto.sdk.ide/plugin.xml327
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java69
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java126
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoGeneralException.java32
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java104
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java245
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java88
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java291
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.java56
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties107
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java116
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java161
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java555
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/InvokeSyncAction.java110
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java134
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoAction.java44
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoHandler.java78
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/YoctoConsole.java24
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java79
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKCMakeProjectNature.java92
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKEmptyProjectNature.java8
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKNatureUtils.java39
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKProjectNature.java36
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java43
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceInitializer.java44
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java63
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java307
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java202
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java240
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java461
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtilsConstants.java18
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoAutotoolsProjectPostProcess.java81
-rw-r--r--plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java270
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.properties14
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.xml17
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.properties14
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.xml16
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.desktop.in.src9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/INSTALL9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src8
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top7
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README25
-rwxr-xr-xplugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/autogen.sh10
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top37
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties28
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml143
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.c50
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.desktop.in.src9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/ChangeLog0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/INSTALL9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.src8
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.top7
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/NEWS0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/README25
-rwxr-xr-xplugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/autogen.sh10
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top49
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top.old37
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.properties28
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.xml142
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp11
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/INSTALL9
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src8
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top6
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS0
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README25
-rwxr-xr-xplugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/autogen.sh10
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top47
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties28
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml142
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/AUTHORS1
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_BSD24
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2339
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2_or_later340
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv3674
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv2.1502
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv3165
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_MIT19
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_Other1
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_BSD29
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv219
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2_or_later21
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv319
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv2.120
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv320
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_MIT24
-rw-r--r--plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_Other9
96 files changed, 7991 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.ide/.classpath b/plugins/org.yocto.sdk.ide/.classpath
new file mode 100644
index 0000000..ad32c83
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/.classpath
@@ -0,0 +1,7 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<classpath>
3 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
4 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5 <classpathentry kind="src" path="src"/>
6 <classpathentry kind="output" path="bin"/>
7</classpath>
diff --git a/plugins/org.yocto.sdk.ide/.project b/plugins/org.yocto.sdk.ide/.project
new file mode 100644
index 0000000..643f947
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/.project
@@ -0,0 +1,32 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<projectDescription>
3 <name>org.yocto.sdk.ide</name>
4 <comment></comment>
5 <projects>
6 <project>org.eclipse.tm.tcf</project>
7 <project>org.eclipse.tm.tcf.core</project>
8 <project>org.eclipse.tm.tcf.rse</project>
9 <project>org.eclipse.tm.tcf.terminals</project>
10 </projects>
11 <buildSpec>
12 <buildCommand>
13 <name>org.eclipse.jdt.core.javabuilder</name>
14 <arguments>
15 </arguments>
16 </buildCommand>
17 <buildCommand>
18 <name>org.eclipse.pde.ManifestBuilder</name>
19 <arguments>
20 </arguments>
21 </buildCommand>
22 <buildCommand>
23 <name>org.eclipse.pde.SchemaBuilder</name>
24 <arguments>
25 </arguments>
26 </buildCommand>
27 </buildSpec>
28 <natures>
29 <nature>org.eclipse.pde.PluginNature</nature>
30 <nature>org.eclipse.jdt.core.javanature</nature>
31 </natures>
32</projectDescription>
diff --git a/plugins/org.yocto.sdk.ide/.settings/org.eclipse.jdt.core.prefs b/plugins/org.yocto.sdk.ide/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..6745823
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
1#Mon May 03 15:24:21 PDT 2010
2eclipse.preferences.version=1
3org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5org.eclipse.jdt.core.compiler.compliance=1.6
6org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
7org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.yocto.sdk.ide/META-INF/MANIFEST.MF b/plugins/org.yocto.sdk.ide/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d8ae504
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/META-INF/MANIFEST.MF
@@ -0,0 +1,37 @@
1Manifest-Version: 1.0
2Bundle-ManifestVersion: 2
3Bundle-Name: %Bundle-Name
4Bundle-SymbolicName: org.yocto.sdk.ide;singleton:=true
5Bundle-Version: 1.4.0.qualifier
6Bundle-Activator: org.yocto.sdk.ide.YoctoSDKPlugin
7Bundle-Vendor: %Bundle-Vendor
8Require-Bundle: org.eclipse.ui,
9 org.eclipse.cdt.ui;bundle-version="5.1.2",
10 org.eclipse.core.runtime,
11 org.eclipse.cdt.core;bundle-version="5.1.2",
12 org.eclipse.core.resources;bundle-version="3.5.1",
13 org.eclipse.debug.core;bundle-version="3.5.1",
14 org.eclipse.cdt.managedbuilder.core,
15 org.eclipse.cdt.autotools.core;bundle-version="1.1.0",
16 org.eclipse.cdt.autotools.ui;bundle-version="1.0.1",
17 org.eclipse.cdt.managedbuilder.ui;bundle-version="8.0.0",
18 org.eclipse.core.expressions;bundle-version="3.4.100",
19 org.eclipse.rse.files.ui;bundle-version="3.1.1",
20 org.eclipse.rse.services;bundle-version="3.2.200",
21 org.eclipse.rse.core;bundle-version="3.1.1",
22 org.eclipse.rse.ui;bundle-version="3.1.1",
23 org.eclipse.rse.subsystems.files.core;bundle-version="3.1.1",
24 org.eclipse.rse.subsystems.shells.core;bundle-version="3.1.0",
25 org.eclipse.cdt.launch.remote;bundle-version="2.4.0",
26 org.eclipse.cdt.debug.mi.core;bundle-version="7.1.0",
27 org.eclipse.cdt.debug.core;bundle-version="7.1.0",
28 org.eclipse.debug.ui;bundle-version="3.5.1",
29 org.eclipse.ui.ide;bundle-version="3.8.0"
30Bundle-RequiredExecutionEnvironment: JavaSE-1.6
31Bundle-ActivationPolicy: lazy
32Export-Package: org.yocto.sdk.ide,
33 org.yocto.sdk.ide.natures,
34 org.yocto.sdk.ide.utils,
35 org.yocto.sdk.ide.actions,
36 org.yocto.sdk.ide.preferences,
37 org.yocto.sdk.ide.wizard
diff --git a/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..2031154
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,16 @@
1#Properties file for org.Yocto.sdk.ide
2page.name.0 = Yocto Project ADT
3extension.name.0 = YoctoSDKNature
4extension.name.1 = YoctoSDKAutotoolsNature
5extension.name.2 = YoctoSDKCMakeNature
6command.name = ReconfigureYoctoProject
7command.label.0 = Change Yocto Project Settings
8command.mnemonic = C
9command.targetProfileSwitch.name = Change Target Profile
10command.targetProfileSwitch.label = Target Profiles
11command.targetProfileSwitch.description = Changes the target profile of a selected project
12command.targetProfileSwitch.parameter.name = Selected Target Profile
13projectType.name.0 = Yocto Project ADT Autotools Project
14projectProperties.label.0 = Yocto Project Settings
15Bundle-Vendor = yoctoproject.org
16Bundle-Name = Yocto Plugin IDE
diff --git a/plugins/org.yocto.sdk.ide/build.properties b/plugins/org.yocto.sdk.ide/build.properties
new file mode 100644
index 0000000..e763a45
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/build.properties
@@ -0,0 +1,9 @@
1source.. = src/
2output.. = bin/
3bin.includes = META-INF/,\
4 .,\
5 plugin.xml,\
6 templates/,\
7 OSGI-INF/
8src.includes = templates/,\
9 OSGI-INF/
diff --git a/plugins/org.yocto.sdk.ide/plugin.xml b/plugins/org.yocto.sdk.ide/plugin.xml
new file mode 100644
index 0000000..c082c3a
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/plugin.xml
@@ -0,0 +1,327 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<?eclipse version="3.4"?>
3<plugin>
4 <extension
5 point="org.eclipse.ui.preferencePages">
6 <page
7 class="org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage"
8 id="org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage"
9 name="%page.name.0">
10 </page>
11 </extension>
12 <extension
13 point="org.eclipse.core.runtime.preferences">
14 <initializer
15 class="org.yocto.sdk.ide.preferences.PreferenceInitializer">
16 </initializer>
17 </extension>
18 <extension
19 id="YoctoSDKNature"
20 name="%extension.name.0"
21 point="org.eclipse.core.resources.natures">
22 <runtime>
23 <run
24 class="org.yocto.sdk.ide.natures.YoctoSDKProjectNature">
25 </run>
26 </runtime>
27 </extension>
28 <extension
29 id="YoctoSDKAutotoolsNature"
30 name="%extension.name.1"
31 point="org.eclipse.core.resources.natures">
32 <requires-nature
33 id="org.yocto.sdk.ide.YoctoSDKNature">
34 </requires-nature>
35 <requires-nature
36 id="org.eclipse.cdt.autotools.core.autotoolsNatureV2">
37 </requires-nature>
38 <runtime>
39 <run
40 class="org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature">
41 </run>
42 </runtime>
43 <one-of-nature
44 id="org.yocto.sdk.ide.buildsystemNaturesSet">
45 </one-of-nature>
46 <builder
47 id="org.eclipse.cdt.autotools.core.genmakebuilderV2">
48 </builder>
49 </extension>
50 <extension
51 id="YoctoSDKCMakeNature"
52 name="%extension.name.2"
53 point="org.eclipse.core.resources.natures">
54 <requires-nature
55 id="org.yocto.sdk.ide.YoctoSDKNature">
56 </requires-nature>
57 <runtime>
58 <run
59 class="org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature">
60 </run>
61 </runtime>
62 <one-of-nature
63 id="org.yocto.sdk.ide.buildsystemNaturesSet">
64 </one-of-nature>
65 </extension>
66 <extension
67 id="YoctoSDKEmptyNature"
68 point="org.eclipse.core.resources.natures">
69 <requires-nature
70 id="org.yocto.sdk.ide.YoctoSDKNature">
71 </requires-nature>
72 <runtime>
73 <run
74 class="org.yocto.sdk.ide.natures.YoctoSDKEmptyProjectNature">
75 </run>
76 </runtime>
77 </extension>
78 <extension
79 point="org.eclipse.ui.commands">
80 <command
81 id="org.yocto.sdk.ide.command.reconfigYocto"
82 name="%command.name">
83 </command>
84 <command
85 id="org.yocto.sdk.ide.command.disabled"
86 name="DisabledCommand">
87 </command>
88 </extension>
89 <extension
90 point="org.eclipse.ui.handlers">
91 <handler
92 class="org.yocto.sdk.ide.actions.ReconfigYoctoHandler"
93 commandId="org.yocto.sdk.ide.command.reconfigYocto">
94 </handler>
95 </extension>
96 <extension
97 point="org.eclipse.ui.menus">
98 <menuContribution
99 locationURI="menu:project">
100 <command
101 commandId="org.yocto.sdk.ide.command.reconfigYocto"
102 id="reconfigure"
103 label="%command.label.0"
104 mnemonic="%command.mnemonic"
105 style="push">
106 <visibleWhen
107 checkEnabled="false">
108 <and>
109 <count
110 value="1">
111 </count>
112 <iterate>
113 <adapt
114 type="org.eclipse.core.resources.IResource">
115 <test
116 property="org.eclipse.core.resources.projectNature"
117 value="org.yocto.sdk.ide.YoctoSDKAutotoolsNature">
118 </test>
119 </adapt>
120 </iterate>
121 </and>
122 </visibleWhen>
123 </command>
124 </menuContribution>
125 </extension>
126 <extension
127 point="org.eclipse.cdt.core.templates">
128 <template
129 filterPattern=".*gcc"
130 id="org.yocto.sdk.ide.template.emptyCProject"
131 location="templates/projecttemplates/EmptyCAutotoolsProject/template.xml"
132 projectType="org.yocto.sdk.ide.projectType">
133 </template>
134 <template
135 filterPattern=".*g\+\+"
136 id="org.yocto.sdk.ide.template.emptyCPPProject"
137 location="templates/projecttemplates/EmptyCPPAutotoolsProject/template.xml"
138 projectType="org.yocto.sdk.ide.projectType">
139 </template>
140 <template
141 filterPattern=".*gcc"
142 id="org.yocto.sdk.ide.template.helloWorldCProject"
143 location="templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml"
144 projectType="org.yocto.sdk.ide.projectType">
145 </template>
146 <template
147 filterPattern=".*g\+\+"
148 id="org.yocto.sdk.ide.template.helloWorldCPPProject"
149 location="templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml"
150 projectType="org.yocto.sdk.ide.projectType">
151 </template>
152 <template
153 filterPattern=".*gcc"
154 id="org.yocto.sdk.ide.template.helloWorldCGTKProject"
155 location="templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.xml"
156 projectType="org.yocto.sdk.ide.projectType">
157 </template>
158 </extension>
159 <extension
160 point="org.eclipse.cdt.core.templateProcessTypes">
161 <processType
162 name="NewYoctoProject"
163 processRunner="org.yocto.sdk.ide.wizard.NewYoctoProjectTemplateProcess">
164 <simple
165 name="name">
166 </simple>
167 <simple
168 external="true"
169 name="location"
170 nullable="true">
171 </simple>
172 <simple
173 external="true"
174 name="artifactExtension">
175 </simple>
176 <simple
177 external="true"
178 name="isCProject">
179 </simple>
180 <simple
181 external="true"
182 name="isEmptyProject">
183 </simple>
184 <simple
185 external="true"
186 name="isAutotoolsProject">
187 </simple>
188 <simple
189 external="true"
190 name="isCMakeProject">
191 </simple>
192 </processType>
193 <processType
194 name="NewYoctoAutotoolsProjectPostProcess"
195 processRunner="org.yocto.sdk.ide.wizard.NewYoctoAutotoolsProjectPostProcess">
196 <simple
197 name="projectName">
198 </simple>
199 </processType>
200 </extension>
201 <extension
202 point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
203 <projectType
204 id="org.yocto.sdk.ide.projectType"
205 isAbstract="true"
206 name="%projectType.name.0"
207 superClass="org.eclipse.linuxtools.cdt.autotools.core.projectType">
208 </projectType>
209 </extension>
210 <extension
211 id="org.yocto.sdk.ide.actions.YoctoConsole"
212 point="org.eclipse.cdt.core.CBuildConsole">
213 <CBuildConsole
214 class="org.yocto.sdk.ide.actions.YoctoConsole"
215 id="org.yocto.sdk.ide.YoctoConsole">
216 </CBuildConsole>
217 </extension>
218 <extension
219 point="org.eclipse.ui.propertyPages">
220 <page
221 adaptable="true"
222 class="org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage"
223 id="org.yocto.sdk.ide.page"
224 name="%projectProperties.label.0"
225 objectClass="org.eclipse.core.resources.IProject">
226 <filter
227 name="projectNature"
228 value="org.yocto.sdk.ide.YoctoSDKNature">
229 </filter>
230 </page>
231 </extension>
232 <extension
233 point="org.eclipse.ui.commands">
234 <command
235 defaultHandler="org.yocto.sdk.ide.actions.ProfileSwitchHandler"
236 description="%command.targetProfileSwitch.description"
237 id="org.yocto.sdk.ide.targetProfile.switch"
238 name="%command.targetProfileSwitch.name">
239 <commandParameter
240 id="org.eclipse.ui.commands.radioStateParameter"
241 name="%command.targetProfileSwitch.parameter.name"
242 optional="false">
243 </commandParameter>
244 <state
245 class="org.eclipse.ui.handlers.RadioState:project-specific"
246 id="org.eclipse.ui.commands.radioState">
247 </state>
248 </command>
249 </extension>
250 <extension
251 point="org.eclipse.ui.menus">
252 <menuContribution
253 allPopups="true"
254 locationURI="menu:project">
255 <menu
256 id="org.yocto.sdk.ide.profiles.menu"
257 label="%command.targetProfileSwitch.label"
258 tooltip="%command.targetProfileSwitch.description">
259 </menu>
260 </menuContribution>
261 <menuContribution
262 allPopups="true"
263 locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
264 <toolbar
265 id="org.yocto.sdk.ide.profiles.toolbar">
266 <command
267 commandId="org.yocto.sdk.ide.command.reconfigYocto"
268 id="org.yocto.sdk.ide.profiles.toolbar.dropdown"
269 label="%command.targetProfileSwitch.label"
270 mode="FORCE_TEXT"
271 style="pulldown"
272 tooltip="%command.targetProfileSwitch.description">
273 <visibleWhen
274 checkEnabled="false">
275 <and>
276 <count
277 value="1">
278 </count>
279 <iterate
280 operator="and">
281 <adapt
282 type="org.eclipse.core.resources.IResource">
283 <test
284 property="org.eclipse.core.resources.projectNature"
285 value="org.yocto.sdk.ide.YoctoSDKNature">
286 </test>
287 </adapt>
288 </iterate>
289 </and>
290 </visibleWhen>
291 </command>
292 </toolbar>
293 </menuContribution>
294 <menuContribution
295 allPopups="false"
296 locationURI="menu:org.yocto.sdk.ide.profiles.menu">
297 <dynamic
298 class="org.yocto.sdk.ide.ProjectSpecificContributionItem"
299 id="org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile">
300 </dynamic>
301 <separator
302 name="org.yocto.sdk.ide.profiles.separator"
303 visible="true">
304 </separator>
305 <dynamic
306 class="org.yocto.sdk.ide.TargetProfileContributionItem"
307 id="org.yocto.sdk.ide.dynamic.targetProfile">
308 </dynamic>
309 </menuContribution>
310 <menuContribution
311 allPopups="false"
312 locationURI="menu:org.yocto.sdk.ide.profiles.toolbar.dropdown">
313 <dynamic
314 class="org.yocto.sdk.ide.ProjectSpecificContributionItem"
315 id="org.yocto.sdk.ide.dynamic.projectSpecific.targetProfile">
316 </dynamic>
317 <separator
318 name="org.yocto.sdk.ide.profiles.separator"
319 visible="true">
320 </separator>
321 <dynamic
322 class="org.yocto.sdk.ide.TargetProfileContributionItem"
323 id="org.yocto.sdk.ide.dynamic.targetProfile">
324 </dynamic>
325 </menuContribution>
326 </extension>
327</plugin>
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
new file mode 100644
index 0000000..c29d278
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/ProjectSpecificContributionItem.java
@@ -0,0 +1,69 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial implementation
10 *******************************************************************************/
11
12package org.yocto.sdk.ide;
13
14import java.util.ArrayList;
15
16import org.eclipse.core.resources.IProject;
17import org.eclipse.jface.action.IContributionItem;
18import org.eclipse.ui.menus.CommandContributionItem;
19import org.eclipse.ui.menus.CommandContributionItemParameter;
20import org.eclipse.ui.services.IServiceLocator;
21import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
22import org.yocto.sdk.ide.actions.ProfileSwitchHandler;
23import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
24
25public class ProjectSpecificContributionItem extends TargetProfileContributionItem {
26 private static final String PROJECT_SPECIFIC_PROFILE =
27 "Preferences.Profile.ProjectSpecific.Profile.Label"; //$NON-NLS-N$
28 private static final String DISABLED_COMMAND_ID = "org.yocto.sdk.ide.command.disabled"; //$NON-NLS-N$
29
30 private IServiceLocator serviceLocator;
31
32 public ProjectSpecificContributionItem() {}
33
34 public ProjectSpecificContributionItem(String id) {
35 super(id);
36 }
37
38 @Override
39 protected IContributionItem[] getContributionItems() {
40 ArrayList<IContributionItem> items = new ArrayList<IContributionItem>();
41
42 IProject project = getSelectedProject(serviceLocator);
43 YoctoUIElement yoctoUIElement = ProjectPreferenceUtils.getElem(project);
44 SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(yoctoUIElement);
45
46 if ((result != SDKCheckResults.SDK_PASS)) {
47 CommandContributionItemParameter parameter = new CommandContributionItemParameter(serviceLocator,
48 null,
49 DISABLED_COMMAND_ID,
50 CommandContributionItem.STYLE_PUSH);
51
52 parameter.label = YoctoSDKMessages.getString(PROJECT_SPECIFIC_PROFILE);
53
54 items.add(new CommandContributionItem(parameter));
55 } else {
56 items.add(super.createProfileItem(serviceLocator, ProfileSwitchHandler.PROJECT_SPECIFIC_PARAMETER,
57 YoctoSDKMessages.getString(PROJECT_SPECIFIC_PROFILE)));
58 }
59
60 updateSelection(serviceLocator);
61
62 return items.toArray(new IContributionItem[items.size()]);
63 }
64
65 @Override
66 public void initialize(IServiceLocator serviceLocator) {
67 this.serviceLocator = serviceLocator;
68 }
69}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
new file mode 100644
index 0000000..95d8229
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/TargetProfileContributionItem.java
@@ -0,0 +1,126 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import java.util.ArrayList;
14import java.util.HashMap;
15import java.util.TreeSet;
16
17import org.eclipse.cdt.core.model.ICElement;
18import org.eclipse.cdt.core.model.ICProject;
19import org.eclipse.core.commands.Command;
20import org.eclipse.core.commands.ExecutionException;
21import org.eclipse.core.resources.IProject;
22import org.eclipse.core.resources.IResource;
23import org.eclipse.core.runtime.IAdaptable;
24import org.eclipse.jface.action.IContributionItem;
25import org.eclipse.jface.viewers.ISelection;
26import org.eclipse.jface.viewers.ITreeSelection;
27import org.eclipse.ui.ISelectionService;
28import org.eclipse.ui.actions.CompoundContributionItem;
29import org.eclipse.ui.commands.ICommandService;
30import org.eclipse.ui.handlers.HandlerUtil;
31import org.eclipse.ui.handlers.RadioState;
32import org.eclipse.ui.menus.CommandContributionItem;
33import org.eclipse.ui.menus.CommandContributionItemParameter;
34import org.eclipse.ui.menus.IWorkbenchContribution;
35import org.eclipse.ui.services.IServiceLocator;
36import org.yocto.sdk.ide.actions.ProfileSwitchHandler;
37import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
38import org.yocto.sdk.ide.utils.YoctoSDKUtils;
39
40public class TargetProfileContributionItem extends CompoundContributionItem implements IWorkbenchContribution {
41 private IServiceLocator serviceLocator;
42
43 public TargetProfileContributionItem() {}
44
45 public TargetProfileContributionItem(String id) {
46 super(id);
47 }
48
49 protected CommandContributionItem createProfileItem(IServiceLocator serviceLocator,
50 String parameter, String label) {
51 CommandContributionItemParameter itemParameter;
52 itemParameter = new CommandContributionItemParameter(serviceLocator,
53 null,
54 ProfileSwitchHandler.PROFILE_SWITCH_COMMAND,
55 CommandContributionItem.STYLE_RADIO);
56
57 HashMap<String, String> params = new HashMap<String, String>();
58 params.put(RadioState.PARAMETER_ID, parameter);
59
60 itemParameter.label = label;
61 itemParameter.parameters = params;
62
63 return new CommandContributionItem(itemParameter);
64 }
65
66 @Override
67 protected IContributionItem[] getContributionItems() {
68 TreeSet<String> profiles = YoctoSDKUtils.getProfilesFromDefaultStore().getProfiles();
69 ArrayList<IContributionItem> items = new ArrayList<IContributionItem>();
70
71 for (String profile : profiles) {
72 items.add(createProfileItem(serviceLocator, profile, profile));
73 }
74
75 updateSelection(serviceLocator);
76
77 return items.toArray(new IContributionItem[profiles.size()]);
78 }
79
80 public IProject getSelectedProject(IServiceLocator serviceLocator) {
81 ISelectionService selectionService = (ISelectionService) serviceLocator.getService(ISelectionService.class);
82 ISelection selection = selectionService.getSelection();
83
84 if (selection instanceof ITreeSelection) {
85 Object selectedItem = ((ITreeSelection) selection).getFirstElement();
86 if (selectedItem instanceof IResource) {
87 return ((IResource) selectedItem).getProject();
88 } else if (selectedItem instanceof ICElement) {
89 ICProject cProject = ((ICElement) selectedItem).getCProject();
90 if (cProject != null) {
91 return cProject.getProject();
92 }
93 } else if (selectedItem instanceof IAdaptable) {
94 Object projectObject = ((IAdaptable) selectedItem).getAdapter(IProject.class);
95 if (projectObject != null && projectObject instanceof IProject) {
96 return ((IProject) projectObject);
97 }
98 }
99 }
100
101 return null;
102 }
103
104 @Override
105 public void initialize(IServiceLocator serviceLocator) {
106 this.serviceLocator = serviceLocator;
107 }
108
109 protected void updateSelection(IServiceLocator serviceLocator) {
110 ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
111 Command command = commandService.getCommand(ProfileSwitchHandler.PROFILE_SWITCH_COMMAND);
112 IProject project = getSelectedProject(serviceLocator);
113
114 try {
115 if (ProjectPreferenceUtils.getUseProjectSpecificOption(project)) {
116 HandlerUtil.updateRadioState(command, ProfileSwitchHandler.PROJECT_SPECIFIC_PARAMETER);
117 return;
118 }
119
120 String selectedProfile = ProjectPreferenceUtils.getProfiles(project).getSelectedProfile();
121 HandlerUtil.updateRadioState(command, selectedProfile);
122 } catch (ExecutionException e) {
123 // ignore
124 }
125 }
126}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoGeneralException.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoGeneralException.java
new file mode 100644
index 0000000..971425c
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoGeneralException.java
@@ -0,0 +1,32 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13/* All specific exceptions raised from yocto project should use
14 * this specific exception class.
15 * Currently we only use it for message printing
16 */
17
18public class YoctoGeneralException extends Exception {
19
20 /**
21 *
22 */
23 private static final long serialVersionUID = 6600798490815526253L;
24 /**
25 *
26 */
27
28 public YoctoGeneralException(String message)
29 {
30 super(message);
31 }
32}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
new file mode 100644
index 0000000..02626ad
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileElement.java
@@ -0,0 +1,104 @@
1/*******************************************************************************
2 * Copyright (c) 2012 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import java.util.Comparator;
14import java.util.StringTokenizer;
15import java.util.TreeSet;
16
17import org.yocto.sdk.ide.preferences.PreferenceConstants;
18
19public class YoctoProfileElement {
20 private TreeSet<String> profiles = new TreeSet<String>(new Comparator<String>() {
21
22 @Override
23 public int compare(String o1, String o2) {
24 int strcompare = o1.compareTo(o2);
25
26 if (strcompare == 0) {
27 return strcompare;
28 }
29
30 // Standard profile always less than anything else
31 if (o1.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
32 return -1;
33 }
34
35 if (o2.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
36 return 1;
37 }
38
39 return strcompare;
40 }
41 });
42
43 private String selectedProfile;
44
45 public YoctoProfileElement(String profilesString, String selectedProfile) {
46 setProfilesFromString(profilesString);
47 this.selectedProfile = selectedProfile;
48 }
49
50 public void addProfile(String profile) {
51 this.profiles.add(profile);
52 }
53
54 public boolean contains(String newText) {
55 return profiles.contains(newText);
56 }
57
58 public TreeSet<String> getProfiles() {
59 return profiles;
60 }
61
62 public String getProfilesAsString() {
63 String profileString = "";
64
65 for (String profile : profiles) {
66 profileString += "\"" + profile + "\",";
67 }
68 return profileString.substring(0, profileString.length() - 1);
69 }
70
71 public String getSelectedProfile() {
72 return selectedProfile;
73 }
74
75 public void remove(String profile) {
76 this.profiles.remove(profile);
77 }
78
79 public void rename(String oldProfileName, String newProfileName) {
80 this.remove(oldProfileName);
81 this.addProfile(newProfileName);
82
83 if (selectedProfile.equals(oldProfileName)) {
84 selectedProfile = newProfileName;
85 }
86 }
87
88 public void setProfiles(TreeSet<String> profiles) {
89 this.profiles = profiles;
90 }
91
92 public void setProfilesFromString(String profilesString) {
93 StringTokenizer tokenizer = new StringTokenizer(profilesString, ",");
94
95 while (tokenizer.hasMoreElements()) {
96 String config = (String) tokenizer.nextElement();
97 profiles.add(config.replace("\"", ""));
98 }
99 }
100
101 public void setSelectedProfile(String selectedProfile) {
102 this.selectedProfile = selectedProfile;
103 }
104}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
new file mode 100644
index 0000000..f56fea4
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProfileSetting.java
@@ -0,0 +1,245 @@
1/*******************************************************************************
2 * Copyright (c) 2012 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import org.eclipse.jface.dialogs.IDialogConstants;
14import org.eclipse.jface.dialogs.InputDialog;
15import org.eclipse.jface.dialogs.MessageDialog;
16import org.eclipse.jface.preference.PreferencePage;
17import org.eclipse.swt.SWT;
18import org.eclipse.swt.events.MouseAdapter;
19import org.eclipse.swt.events.MouseEvent;
20import org.eclipse.swt.layout.GridData;
21import org.eclipse.swt.layout.GridLayout;
22import org.eclipse.swt.widgets.Button;
23import org.eclipse.swt.widgets.Combo;
24import org.eclipse.swt.widgets.Composite;
25import org.eclipse.swt.widgets.Event;
26import org.eclipse.swt.widgets.Group;
27import org.eclipse.swt.widgets.Listener;
28import org.yocto.sdk.ide.preferences.PreferenceConstants;
29import org.yocto.sdk.ide.preferences.ProfileNameInputValidator;
30import org.yocto.sdk.ide.preferences.YoctoSDKPreferencePage;
31import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
32
33public class YoctoProfileSetting {
34 private static final String PROFILES_TITLE = "Preferences.Profiles.Title";
35 private static final String NEW_PROFILE_TITLE = "Preferences.Profile.New.Title";
36 private static final String RENAME_PROFILE_TITLE = "Preferences.Profile.Rename.Title";
37 private static final String RENAME_DIALOG_TITLE = "Preferences.Profile.Rename.Dialog.Title";
38 private static final String RENAME_DIALOG_MESSAGE = "Preferences.Profile.Rename.Dialog.Message";
39 private static final String REMOVE_PROFILE_TITLE = "Preferences.Profile.Remove.Title";
40 private static final String REMOVE_DIALOG_TITLE = "Preferences.Profile.Remove.Dialog.Title";
41 private static final String REMOVE_DIALOG_MESSAGE = "Preferences.Profile.Remove.Dialog.Message";
42 private static final String MODIFY_STANDARD_TITLE = "Preferences.Profile.Standard.Modification.Title";
43 private static final String MODIFY_STANDARD_MESSAGE = "Preferences.Profile.Standard.Modification.Message";
44
45 private Combo sdkConfigsCombo;
46 private Button btnConfigRename;
47 private Button btnConfigRemove;
48 private Button btnConfigSaveAs;
49
50 private YoctoProfileElement profileElement;
51 private PreferencePage preferencePage;
52 private final boolean editable;
53
54 public YoctoProfileSetting(YoctoProfileElement profileElement, PreferencePage preferencePage, final boolean editable) {
55 this.profileElement = profileElement;
56 this.preferencePage = preferencePage;
57 this.editable = editable;
58 }
59
60 public void createComposite(Composite composite) {
61 GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
62 GridLayout layout = new GridLayout(2, false);
63
64 Group storeYoctoConfigurationsGroup = new Group (composite, SWT.NONE);
65 layout = new GridLayout(1, false);
66 if (isEditable()) {
67 layout.numColumns = 3;
68 }
69
70 storeYoctoConfigurationsGroup.setLayout(layout);
71 gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
72 gd.horizontalSpan = 2;
73 storeYoctoConfigurationsGroup.setLayoutData(gd);
74 storeYoctoConfigurationsGroup.setText(YoctoSDKMessages.getString(PROFILES_TITLE));
75
76 sdkConfigsCombo = new Combo(storeYoctoConfigurationsGroup, SWT.READ_ONLY);
77 addConfigs(sdkConfigsCombo);
78 sdkConfigsCombo.select(sdkConfigsCombo.indexOf(profileElement.getSelectedProfile()));
79 sdkConfigsCombo.setLayout(new GridLayout(2, false));
80 sdkConfigsCombo.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
81
82 Listener selectionListener = new Listener() {
83 @Override
84 public void handleEvent(Event event) {
85 Object source = event.widget;
86 if (!(source instanceof Combo)) {
87 return;
88 }
89
90 Combo sdkCombo = (Combo) source;
91 if (sdkCombo.getSelectionIndex() < 0) {
92 return;
93 }
94
95 String selectedItem = sdkCombo.getItem(sdkCombo.getSelectionIndex());
96 profileElement.setSelectedProfile(selectedItem);
97
98 if (preferencePage instanceof YoctoSDKPreferencePage) {
99 ((YoctoSDKPreferencePage) preferencePage).switchProfile(selectedItem);
100 } else if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
101 ((YoctoSDKProjectPropertyPage) preferencePage).switchProfile(selectedItem);
102 }
103 }
104 };
105
106 sdkConfigsCombo.addListener(SWT.Selection, selectionListener);
107 sdkConfigsCombo.addListener(SWT.Modify, selectionListener);
108
109 if (isEditable()) {
110 createSaveAsProfileButton(storeYoctoConfigurationsGroup);
111 createRenameButton(storeYoctoConfigurationsGroup);
112 createRemoveButton(storeYoctoConfigurationsGroup);
113 }
114 }
115
116 private void createSaveAsProfileButton(Group storeYoctoConfigurationsGroup) {
117 btnConfigSaveAs = new Button(storeYoctoConfigurationsGroup, SWT.PUSH | SWT.LEAD);
118 btnConfigSaveAs.setText(YoctoSDKMessages.getString(NEW_PROFILE_TITLE));
119 btnConfigSaveAs.addMouseListener(new MouseAdapter() {
120 @Override
121 public void mouseDown(MouseEvent e) {
122 if (preferencePage instanceof YoctoSDKPreferencePage) {
123 ((YoctoSDKPreferencePage) preferencePage).performSaveAs();
124 }
125 }
126 });
127 }
128
129 private void createRemoveButton(Group storeYoctoConfigurationsGroup) {
130 btnConfigRemove = new Button(storeYoctoConfigurationsGroup, SWT.PUSH | SWT.LEAD);
131 btnConfigRemove.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, false, 3, 1));
132 btnConfigRemove.setText(YoctoSDKMessages.getString(REMOVE_PROFILE_TITLE));
133 btnConfigRemove.addMouseListener(new MouseAdapter() {
134 @Override
135 public void mouseDown(MouseEvent e) {
136 saveChangesOnCurrentProfile();
137 int selectionIndex = sdkConfigsCombo.getSelectionIndex();
138 String selectedItem = sdkConfigsCombo.getItem(selectionIndex);
139
140 if (selectedItem.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
141 MessageDialog.openInformation(null,
142 YoctoSDKMessages.getString(MODIFY_STANDARD_TITLE),
143 YoctoSDKMessages.getString(MODIFY_STANDARD_MESSAGE));
144 return;
145 }
146
147 boolean deleteConfirmed =
148 MessageDialog.openConfirm(null,
149 YoctoSDKMessages.getString(REMOVE_DIALOG_TITLE),
150 YoctoSDKMessages.getFormattedString(REMOVE_DIALOG_MESSAGE, selectedItem));
151
152 if (!deleteConfirmed) {
153 return;
154 }
155
156 sdkConfigsCombo.select(0);
157 sdkConfigsCombo.remove(selectionIndex);
158 profileElement.remove(selectedItem);
159
160 if (preferencePage instanceof YoctoSDKPreferencePage) {
161 ((YoctoSDKPreferencePage) preferencePage).deleteProfile(selectedItem);
162 }
163 }
164 });
165 }
166
167 private void createRenameButton(Group storeYoctoConfigurationsGroup) {
168 btnConfigRename = new Button(storeYoctoConfigurationsGroup, SWT.PUSH | SWT.LEAD);
169 btnConfigRename.setText(YoctoSDKMessages.getString(RENAME_PROFILE_TITLE));
170 btnConfigRename.addMouseListener(new MouseAdapter() {
171 @Override
172 public void mouseDown(MouseEvent e) {
173 saveChangesOnCurrentProfile();
174 int selectedIndex = sdkConfigsCombo.getSelectionIndex();
175 final String selectedItem = sdkConfigsCombo.getItem(selectedIndex);
176
177 if (selectedItem.equals(PreferenceConstants.STANDARD_PROFILE_NAME)) {
178 MessageDialog.openInformation(null,
179 YoctoSDKMessages.getString(MODIFY_STANDARD_TITLE),
180 YoctoSDKMessages.getString(MODIFY_STANDARD_MESSAGE));
181 return;
182 }
183
184 InputDialog profileNameDialog =
185 new InputDialog(null,
186 YoctoSDKMessages.getString(RENAME_DIALOG_TITLE),
187 YoctoSDKMessages.getString(RENAME_DIALOG_MESSAGE),
188 null,
189 new ProfileNameInputValidator(profileElement, selectedItem));
190
191 int returnCode = profileNameDialog.open();
192 if (returnCode == IDialogConstants.CANCEL_ID) {
193 return;
194 }
195
196 String newProfileName = profileNameDialog.getValue();
197 profileElement.rename(selectedItem, profileNameDialog.getValue());
198
199 if (preferencePage instanceof YoctoSDKPreferencePage) {
200 ((YoctoSDKPreferencePage) preferencePage).renameProfile(selectedItem, newProfileName);
201 }
202
203 sdkConfigsCombo.setItem(selectedIndex, newProfileName);
204 sdkConfigsCombo.select(selectedIndex);
205 }
206 });
207 }
208
209 private void saveChangesOnCurrentProfile() {
210 preferencePage.performOk();
211 }
212
213 private void addConfigs(Combo combo) {
214 for (String profile : profileElement.getProfiles()) {
215 combo.add(profile);
216 }
217 }
218
219 public void addProfile(String profileName) {
220 int index = sdkConfigsCombo.getItemCount();
221 sdkConfigsCombo.add(profileName, index);
222 sdkConfigsCombo.select(index);
223 }
224
225 public void setUIFormEnabledState(boolean isEnabled) {
226 setButtonsEnabledState(isEnabled);
227 sdkConfigsCombo.setEnabled(isEnabled);
228 }
229
230 public YoctoProfileElement getCurrentInput() {
231 return profileElement;
232 }
233
234 public void setButtonsEnabledState(boolean isEnabled) {
235 if (isEditable()) {
236 btnConfigRename.setEnabled(isEnabled);
237 btnConfigRemove.setEnabled(isEnabled);
238 btnConfigSaveAs.setEnabled(isEnabled);
239 }
240 }
241
242 private boolean isEditable() {
243 return editable;
244 }
245}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
new file mode 100644
index 0000000..2a55a64
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoProjectSpecificSetting.java
@@ -0,0 +1,88 @@
1/*******************************************************************************
2 * Copyright (c) 2012 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import org.eclipse.jface.preference.PreferencePage;
14import org.eclipse.swt.SWT;
15import org.eclipse.swt.events.SelectionEvent;
16import org.eclipse.swt.events.SelectionListener;
17import org.eclipse.swt.layout.GridData;
18import org.eclipse.swt.layout.GridLayout;
19import org.eclipse.swt.widgets.Button;
20import org.eclipse.swt.widgets.Composite;
21import org.eclipse.swt.widgets.Group;
22import org.yocto.sdk.ide.preferences.YoctoSDKProjectPropertyPage;
23
24public class YoctoProjectSpecificSetting {
25 private static final String PROJECT_SPECIFIC_TITLE = "Preferences.Profile.ProjectSpecific.Title";
26 private static final String PROJECT_SPECIFIC_GROUP_TITLE = "Preferences.Profile.ProjectSpecific.Group.Title";
27
28 private YoctoProfileSetting yoctoConfigurationsSetting;
29 private YoctoUISetting yoctoUISetting;
30
31 private Button btnUseProjectSpecificSettingsCheckbox;
32 private PreferencePage preferencePage;
33
34 public YoctoProjectSpecificSetting(YoctoProfileSetting yoctoConfigurationsSetting,
35 YoctoUISetting yoctoUISetting, PreferencePage preferencePage) {
36 this.yoctoConfigurationsSetting = yoctoConfigurationsSetting;
37 this.yoctoUISetting = yoctoUISetting;
38 this.preferencePage = preferencePage;
39 }
40
41 public void createComposite(Composite composite) {
42 GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
43 GridLayout layout = new GridLayout(2, false);
44
45 Group storeYoctoConfigurationsGroup = new Group (composite, SWT.NONE);
46 layout = new GridLayout(2, false);
47 storeYoctoConfigurationsGroup.setLayout(layout);
48 gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
49 gd.horizontalSpan = 2;
50 storeYoctoConfigurationsGroup.setLayoutData(gd);
51 storeYoctoConfigurationsGroup.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_GROUP_TITLE));
52
53 btnUseProjectSpecificSettingsCheckbox = new Button(storeYoctoConfigurationsGroup, SWT.CHECK);
54 btnUseProjectSpecificSettingsCheckbox.setText(YoctoSDKMessages.getString(PROJECT_SPECIFIC_TITLE));
55 btnUseProjectSpecificSettingsCheckbox.addSelectionListener(new SelectionListener() {
56 @Override
57 public void widgetSelected(SelectionEvent e) {
58 if (btnUseProjectSpecificSettingsCheckbox.getSelection()){
59 yoctoConfigurationsSetting.setUIFormEnabledState(false);
60 yoctoUISetting.setUIFormEnabledState(true);
61
62 if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
63 ((YoctoSDKProjectPropertyPage) preferencePage).switchToProjectSpecificProfile();
64 }
65 } else {
66 yoctoConfigurationsSetting.setUIFormEnabledState(true);
67 yoctoConfigurationsSetting.setButtonsEnabledState(false);
68 yoctoUISetting.setUIFormEnabledState(false);
69
70 if (preferencePage instanceof YoctoSDKProjectPropertyPage) {
71 ((YoctoSDKProjectPropertyPage) preferencePage).switchToSelectedProfile();
72 }
73 }
74 }
75
76 @Override
77 public void widgetDefaultSelected(SelectionEvent e) {}
78 });
79 }
80
81 public void setUseProjectSpecificSettings(boolean isUsingProjectSpecificSettings) {
82 btnUseProjectSpecificSettingsCheckbox.setSelection(isUsingProjectSpecificSettings);
83 }
84
85 public boolean isUsingProjectSpecificSettings() {
86 return btnUseProjectSpecificSettingsCheckbox.getSelection();
87 }
88}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
new file mode 100644
index 0000000..714470b
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKChecker.java
@@ -0,0 +1,291 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * Copyright (c) 2013 BMW Car IT GmbH.
4 *
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *
10 * Contributors:
11 * Intel - initial API and implementation
12 * BMW Car IT - include error and advice messages with check results
13 *******************************************************************************/
14package org.yocto.sdk.ide;
15
16import java.io.BufferedReader;
17import java.io.File;
18import java.io.FileReader;
19import java.io.FilenameFilter;
20import java.io.IOException;
21import java.io.InputStream;
22import java.io.InputStreamReader;
23
24import org.eclipse.jface.preference.IPreferenceStore;
25import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
26import org.yocto.sdk.ide.utils.YoctoSDKUtils;
27import org.yocto.sdk.ide.utils.YoctoSDKUtilsConstants;
28
29public class YoctoSDKChecker {
30 private static final String[] saInvalidVer = {"1.0", "0.9", "0.9+"};
31 private static final String SYSROOTS_DIR = "sysroots";
32 private static final String SDK_VERSION = "OECORE_SDK_VERSION";
33
34 public static enum SDKCheckResults {
35 SDK_PASS("", false),
36 TOOLCHAIN_LOCATION_EMPTY(
37 "Poky.SDK.Location.Empty", true),
38 TOOLCHAIN_LOCATION_NONEXIST(
39 "Poky.SDK.Location.Nonexist", true),
40 SDK_TARGET_EMPTY(
41 "Poky.SDK.Target.Empty", true),
42 SDK_NO_TARGET_SELECTED(
43 "Poky.SDK.No.Target.Selected", false),
44 SYSROOT_EMPTY(
45 "Poky.Sysroot.Empty", true),
46 SYSROOT_NONEXIST(
47 "Poky.Sysroot.Nonexist", true),
48 QEMU_KERNEL_EMPTY(
49 "Poky.Qemu.Kernel.Empty", true),
50 QEMU_KERNEL_NONEXIST(
51 "Poky.Qemu.Kernel.Nonexist", true),
52 WRONG_ADT_VERSION(
53 "Poky.ADT.Sysroot.Wrongversion", false),
54 ENV_SETUP_SCRIPT_NONEXIST(
55 "Poky.Env.Script.Nonexist", false),
56 TOOLCHAIN_NO_SYSROOT(
57 "Poky.Toolchain.No.Sysroot", false),
58 TOOLCHAIN_HOST_MISMATCH(
59 "Poky.Toolchain.Host.Mismatch", false);
60
61 private static final String DEFAULT_ADVICE = "Default.Advice";
62 private static final String ADVICE_SUFFIX = ".Advice";
63
64 private final String messageID;
65 private final boolean addDefaultAdvice;
66
67 private SDKCheckResults(final String messageID, final boolean addDefaultAdvice) {
68 this.messageID = messageID;
69 this.addDefaultAdvice = addDefaultAdvice;
70 }
71
72 public String getMessage() {
73 return YoctoSDKMessages.getString(messageID);
74 }
75
76 public String getAdvice() {
77 String advice = YoctoSDKMessages.getString(messageID + ADVICE_SUFFIX);
78
79 if (addDefaultAdvice) {
80 advice += YoctoSDKMessages.getString(DEFAULT_ADVICE);
81 }
82
83 return advice;
84 }
85 };
86
87 public static enum SDKCheckRequestFrom {
88 Wizard("Poky.SDK.Error.Origin.Wizard"),
89 Menu("Poky.SDK.Error.Origin.Menu"),
90 Preferences("Poky.SDK.Error.Origin.Preferences"),
91 Other("Poky.SDK.Error.Origin.Other");
92
93 private final String errorMessageID;
94
95 private SDKCheckRequestFrom(final String errorMessageID) {
96 this.errorMessageID = errorMessageID;
97 }
98
99 public String getErrorMessage() {
100 return YoctoSDKMessages.getString(errorMessageID);
101 }
102 };
103
104 public static void checkIfGloballySelectedYoctoProfileIsValid() throws YoctoGeneralException {
105 YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
106 IPreferenceStore selectedProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
107 YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selectedProfileStore);
108
109 SDKCheckResults result = checkYoctoSDK(elem);
110 if (result != SDKCheckResults.SDK_PASS){
111 String strErrorMsg = getErrorMessage(result, SDKCheckRequestFrom.Wizard);
112 throw new YoctoGeneralException(strErrorMsg);
113 }
114 }
115
116 public static SDKCheckResults checkYoctoSDK(YoctoUIElement elem) {
117 if (elem.getStrToolChainRoot().isEmpty())
118 return SDKCheckResults.TOOLCHAIN_LOCATION_EMPTY;
119 else {
120 File fToolChain = new File(elem.getStrToolChainRoot());
121 if (!fToolChain.exists())
122 return SDKCheckResults.TOOLCHAIN_LOCATION_NONEXIST;
123 }
124
125 if (elem.getStrSysrootLoc().isEmpty()) {
126 return SDKCheckResults.SYSROOT_EMPTY;
127 } else {
128 File fSysroot = new File(elem.getStrSysrootLoc());
129 if (!fSysroot.exists())
130 return SDKCheckResults.SYSROOT_NONEXIST;
131 }
132
133 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
134 //Check for SDK compatible with the host arch
135 String platform = getPlatformArch();
136 String sysroot_dir_str = elem.getStrToolChainRoot() + "/" + SYSROOTS_DIR;
137 File sysroot_dir = new File(sysroot_dir_str);
138 if (!sysroot_dir.exists())
139 return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
140
141 String toolchain_host_arch = null;
142
143 try {
144 toolchain_host_arch = findHostArch(sysroot_dir);
145 } catch(NullPointerException e) {
146 return SDKCheckResults.TOOLCHAIN_NO_SYSROOT;
147 }
148
149 if (!toolchain_host_arch.equalsIgnoreCase(platform)) {
150 if (!platform.matches("i\\d86") || !toolchain_host_arch.matches("i\\d86"))
151 return SDKCheckResults.TOOLCHAIN_HOST_MISMATCH;
152 }
153 }
154
155 if (elem.getStrTarget().isEmpty() && elem.getStrTargetsArray().length > 0) {
156 return SDKCheckResults.SDK_NO_TARGET_SELECTED;
157 }
158
159 if (elem.getIntTargetIndex() < 0 || elem.getStrTarget().isEmpty()) {
160 //if this is poky tree mode, prompt user whether bitbake meta-ide-support is executed?
161 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_TREE_MODE)
162 return SDKCheckResults.ENV_SETUP_SCRIPT_NONEXIST;
163 else
164 return SDKCheckResults.SDK_TARGET_EMPTY;
165 } else {
166 String sFileName;
167
168 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
169 sFileName = elem.getStrToolChainRoot()+"/" + YoctoSDKUtilsConstants.DEFAULT_ENV_FILE_PREFIX + elem.getStrTarget();
170 } else {
171 //POKY TREE Mode
172 sFileName = elem.getStrToolChainRoot() + YoctoSDKUtilsConstants.DEFAULT_TMP_PREFIX +
173 YoctoSDKUtilsConstants.DEFAULT_ENV_FILE_PREFIX + elem.getStrTarget();
174 }
175
176 try {
177 File file = new File(sFileName);
178 boolean bVersion = false;
179
180 if (file.exists()) {
181 BufferedReader input = new BufferedReader(new FileReader(file));
182
183 try {
184 String line = null;
185
186 while ((line = input.readLine()) != null) {
187 if (line.startsWith("export "+ SDK_VERSION)) {
188 int beginIndex = 2;
189 String sVersion = "";
190 for (;;) {
191 char cValue = line.charAt(line.indexOf('=') + beginIndex++);
192
193 if ((cValue != '.') && (!Character.isDigit(cValue)) && (cValue != '+'))
194 break;
195 else
196 sVersion += String.valueOf(cValue);
197 }
198
199 for (int i = 0; i < saInvalidVer.length; i++) {
200 if (!sVersion.equals(saInvalidVer[i])) {
201 bVersion = true;
202 break;
203 }
204 }
205
206 break;
207 }
208 }
209 } finally {
210 input.close();
211 }
212
213 if (!bVersion)
214 return SDKCheckResults.WRONG_ADT_VERSION;
215 }
216 } catch (IOException e) {
217 e.printStackTrace();
218 }
219 }
220
221 if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
222 if (elem.getStrQemuKernelLoc().isEmpty()) {
223 return SDKCheckResults.QEMU_KERNEL_EMPTY;
224 } else {
225 File fQemuKernel = new File(elem.getStrQemuKernelLoc());
226 if (!fQemuKernel.exists())
227 return SDKCheckResults.QEMU_KERNEL_NONEXIST;
228 }
229 }
230
231 return SDKCheckResults.SDK_PASS;
232 }
233
234 public static String getErrorMessage(SDKCheckResults result, SDKCheckRequestFrom from) {
235 String strErrorMsg;
236 strErrorMsg = from.getErrorMessage();
237 strErrorMsg += "\n" + result.getMessage();
238 strErrorMsg += "\n" + result.getAdvice();
239
240 return strErrorMsg;
241 }
242
243 private static String getPlatformArch() {
244 String value = null;
245 try
246 {
247 Runtime rt = Runtime.getRuntime();
248 Process proc = rt.exec("uname -m");
249 InputStream stdin = proc.getInputStream();
250 InputStreamReader isr = new InputStreamReader(stdin);
251 BufferedReader br = new BufferedReader(isr);
252 String line = null;
253
254 while ( (line = br.readLine()) != null) {
255 value = line;
256 }
257 proc.waitFor();
258
259 } catch (Throwable t) {
260 t.printStackTrace();
261 }
262 return value;
263 }
264
265 private static String findHostArch(File sysroot_dir) {
266 FilenameFilter nativeFilter = new FilenameFilter() {
267 public boolean accept(File dir, String name) {
268 if (name.endsWith("sdk-linux")) {
269 return true;
270 } else {
271 return false;
272 }
273 }
274 };
275
276 File[] files = sysroot_dir.listFiles(nativeFilter);
277 String arch = null;
278
279 for (File file : files) {
280 if (file.isDirectory()) {
281 String path = file.getName();
282 String[] subPath = path.split("-");
283 arch = subPath[0];
284 } else {
285 continue;
286 }
287 }
288
289 return arch;
290 }
291}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.java
new file mode 100644
index 0000000..8fe40d3
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.java
@@ -0,0 +1,56 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import java.text.MessageFormat;
14import java.util.MissingResourceException;
15import java.util.ResourceBundle;
16
17public class YoctoSDKMessages {
18 private static final String RESOURCE_BUNDLE= YoctoSDKMessages.class.getName();
19 private static ResourceBundle fgResourceBundle;
20 static {
21 try {
22 fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
23 } catch (MissingResourceException x) {
24 fgResourceBundle = null;
25 }
26 }
27
28 private YoctoSDKMessages() {
29 }
30
31 public static String getString(String key) {
32 try {
33 return fgResourceBundle.getString(key);
34 } catch (MissingResourceException e) {
35 return '!' + key + '!';
36 } catch (NullPointerException e) {
37 return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
38 }
39 }
40
41 /**
42 * Gets a string from the resource bundle and formats it with the argument
43 *
44 * @param key the string used to get the bundle value, must not be null
45 */
46 public static String getFormattedString(String key, Object arg) {
47 return MessageFormat.format(getString(key), new Object[] { arg });
48 }
49
50 /**
51 * Gets a string from the resource bundle and formats it with arguments
52 */
53 public static String getFormattedString(String key, Object[] args) {
54 return MessageFormat.format(getString(key), args);
55 }
56}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
new file mode 100644
index 0000000..e3f3308
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKMessages.properties
@@ -0,0 +1,107 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 * BMW Car IT - added keys for target profiles
11 *******************************************************************************/
12Wizard.SDK.Warning.Title = Invalid Yocto Project ADT Location
13Wizard.SDK.Error.ProjectName = Project name "{0}" is invalid! \nNone of these characters are accepted inside project names: whitespaces, {1}
14
15Poky.SDK.Location.Empty = Specified Toolchain Root Location is empty.
16Poky.SDK.Location.Empty.Advice = You need specify Toolchain Root Location before building any project.
17Poky.SDK.Location.Nonexist = Specified SDK toolchain directory does not exist.
18Poky.SDK.Location.Nonexist.Advice = Please specify a valid toolchain directory.
19Poky.SDK.Target.Empty = Specified location does not contain environment script file.
20Poky.SDK.Target.Empty.Advice = You need specify Target Architecture before building any project.
21Poky.SDK.No.Target.Selected = Target Architecture is not defined.
22Poky.SDK.No.Target.Selected.Advice = Please choose a Target Architecture.
23Poky.Sysroot.Empty = Specified Sysroot Location is empty.
24Poky.Sysroot.Empty.Advice = You need specify Sysroot Location before building any project.
25Poky.Sysroot.Nonexist = Specified Sysroot Location does not exist.
26Poky.Sysroot.Nonexist.Advice = You need specify a valid Sysroot Location before building any project.
27Poky.Qemu.Kernel.Empty = Specified QEMU kernel location is emtpy.
28Poky.Qemu.Kernel.Empty.Advice = You need specify QEMU kernel image file Location before building any project.
29Poky.Qemu.Kernel.Nonexist = Specified QEMU kernel image file does not exist.
30Poky.Qemu.Kernel.Empty.Advice = You need specify a valid QEMU kernel image file before building any project.
31Poky.ADT.Sysroot.Wrongversion = The ADT version you're using is too old.
32Poky.ADT.Sysroot.Wrongversion.Advice = OECORE related items are not found in environment setup files.\nPlease upgrade to our latest ADT Version!
33Poky.Env.Script.Nonexist = Specified toolchain directory does not contain a toolchain generated with "bitbake meta-ide-support".
34Poky.Env.Script.Nonexist.Advice = Please run "bitbake meta-ide-support" to build the toolchain.
35Poky.Toolchain.No.Sysroot = Specified Toolchain Root Location does not contain a sysroot directory.
36Poky.Toolchain.No.Sysroot.Advice = Please install a valid toolchain sysroot.
37Poky.Toolchain.Host.Mismatch = Toolchain and host arch mismatch.
38Poky.Toolchain.Host.Mismatch.Advice = Make sure you use 32bit toolchain for 32bit host and same for 64bit machines!
39
40Default.Advice = \nDo IDE-wide settings from Window > Preferences > Yocto Project ADT\nOr do Project-wide settings from Project > Change Yocto Project Settings.
41Poky.SDK.Revalidation.Message = Please apply the changes to revalidate.
42
43Poky.SDK.Error.Origin.Wizard = Yocto Wizard Configuration Error:
44Poky.SDK.Error.Origin.Menu = Yocto Menu Configuration Error:
45Poky.SDK.Error.Origin.Preferences = Yocto Preferences Configuration Error:
46Poky.SDK.Error.Origin.Other = Yocto Configuration Error:
47
48Menu.SDK.Console.Configure.Message = The Yocto Project ADT has been successfully set up for this project.\nTo see the environment variables created during setup,\ngo to Project > Properties > C/C++ Build > Environment.
49Menu.SDK.Console.Deploy.Action.Message = \nDeploying {0} to {1} ...\n
50Menu.SDK.Console.Deploy.Extract.Message = \nExtracting {0} into {1} ...\n
51Menu.SDK.Console.Deploy.Success.Message = \nThe project {0} has been successfully deployed to {1}\n
52Menu.SDK.Console.Deploy.Fail.Message = \nDeploying the project {0} to {1} failed!\n
53Menu.SDK.Console.Undeploy.Success.Message = \nThe project {0} has been successfully undeployed from {1}\n
54Menu.SDK.Console.Undeploy.Fail.Message = \nUndeploying the project {0} from {1} failed!\n
55
56
57Menu.Deploy.Title = Deploy {0} to ...
58Menu.Deploy.Message = Please specify a directory:
59
60Menu.Undeploy.Title = Undeploy {0} from ...
61Menu.Undeploy.Message = Please specify a directory:
62
63
64Preferences.Yocto.Config.Name = Preferences:
65Preferences.SDK.Target.name = Target Preferences:
66Preferences.SDK.Informing.Title = Yocto Project ADT has been successfully set up.
67Preferences.SDK.Informing.Message = You might need to reconfigure your existing Yocto Project Autotools Projects to use the Yocto Project ADT. Do this from Project > Reconfigure Project!
68
69Preferences.Profile.Validator.InvalidName.Comma = Warning: The profile name cannot contain a comma (,).
70Preferences.Profile.Validator.InvalidName.Quote = Warning: The profile name cannot contain a double quote (\").
71Preferences.Profile.Validator.InvalidName.Empty = Please provide a new profile name.
72Preferences.Profile.Validator.InvalidName.Exists = Warning: The profile already exists.
73
74Preferences.Profiles.Title = Cross development profiles:
75Preferences.Profile.New.Title = Save as ...
76Preferences.Profile.New.Dialog.Title = Save as new cross development profile
77Preferences.Profile.New.Dialog.Message = Please input a profile name.
78Preferences.Profile.Rename.Title = Rename
79Preferences.Profile.Rename.Dialog.Title = Rename cross development profile
80Preferences.Profile.Rename.Dialog.Message = Please input a new profile name.
81Preferences.Profile.Remove.Title = Remove
82Preferences.Profile.Remove.Dialog.Title = Remove cross development profile
83Preferences.Profile.Remove.Dialog.Message = Do you really want to the remove the cross development profile "{0}"?\nProjects using this cross development profile will be reconfigured to use the standard profile.
84Preferences.Profile.Update.Dialog.Title = Update cross development profile
85Preferences.Profile.Update.Dialog.Message = Do you really want to the update the cross development profile "{0}"?\nProjects using this cross development profile will be reconfigured.
86Preferences.Profile.Standard.Modification.Title = Modify standard cross development profile
87Preferences.Profile.Standard.Modification.Message = Standard cross development profile cannot be removed or renamed.
88
89Preferences.Profile.ProjectSpecific.Title = Use project specific settings
90Preferences.Profile.ProjectSpecific.Group.Title = Project specific settings:
91Preferences.Profile.ProjectSpecific.Profile.Label = Project specific profile
92
93Preferences.Profile.ProjectSpecific.Error.Title = Could not change to project specific target profile
94Preferences.Profile.ProjectSpecific.Error.Message = The project specific target profile is not defined for the project "{0}".\nYou can define it in the project's property page.
95
96Console.SDK.Name = Yocto Project Console
97
98LaunchConfig.Type.Name = org.eclipse.ui.externaltools.ProgramLaunchConfigurationType
99LaunchConfig.LaunchGroup.Value = org.eclipse.ui.externaltools.launchGroup
100LaunchConfig.LaunchGroup.Attr = org.eclipse.debug.ui.favoriteGroups
101LaunchConfig.BuildScope.Attr = org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE
102LaunchConfig.BuildScope.Value = ${projects:}
103LaunchConfig.Location.Attr = org.eclipse.ui.externaltools.ATTR_LOCATION
104LaunchConfig.Arguments.Attr = org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS;
105
106AutotoolsProjectPostProcess.WrongProjectNature = {0} is not an Autotools project
107AutotoolsProjectPostProcess.ChmodFailure = Failed to make autogen.sh executable for project: {0}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
new file mode 100644
index 0000000..9777396
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoSDKPlugin.java
@@ -0,0 +1,116 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import java.lang.reflect.InvocationTargetException;
14
15import org.eclipse.core.resources.ResourcesPlugin;
16import org.eclipse.core.runtime.CoreException;
17import org.eclipse.core.runtime.IStatus;
18import org.eclipse.core.runtime.Status;
19import org.eclipse.core.runtime.preferences.InstanceScope;
20import org.eclipse.jface.preference.IPreferenceStore;
21import org.eclipse.swt.widgets.Shell;
22import org.eclipse.ui.IWorkbenchWindow;
23import org.eclipse.ui.plugin.AbstractUIPlugin;
24import org.eclipse.ui.preferences.ScopedPreferenceStore;
25import org.osgi.framework.BundleContext;
26
27/**
28 * The activator class controls the plug-in life cycle
29 */
30public class YoctoSDKPlugin extends AbstractUIPlugin {
31
32 // The plug-in ID
33 public static final String PLUGIN_ID = "org.yocto.sdk.ide";
34
35 // The shared instance
36 private static YoctoSDKPlugin plugin;
37
38 /**
39 * The constructor
40 */
41 public YoctoSDKPlugin() {
42 }
43
44 /*
45 * (non-Javadoc)
46 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
47 */
48 public void start(BundleContext context) throws Exception {
49 super.start(context);
50 plugin = this;
51 }
52
53 /*
54 * (non-Javadoc)
55 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
56 */
57 public void stop(BundleContext context) throws Exception {
58 plugin = null;
59 super.stop(context);
60 }
61
62 /**
63 * Returns the shared instance
64 *
65 * @return the shared instance
66 */
67 public static YoctoSDKPlugin getDefault() {
68 return plugin;
69 }
70
71 public static IPreferenceStore getProfilePreferenceStore(String profileName) {
72 int profileIdentifier = profileName.hashCode();
73
74 return new ScopedPreferenceStore(InstanceScope.INSTANCE,getUniqueIdentifier() + "." + profileIdentifier);
75 }
76
77 public static void log(IStatus status) {
78 ResourcesPlugin.getPlugin().getLog().log(status);
79 }
80
81 public static void log(Throwable e) {
82 if (e instanceof InvocationTargetException)
83 e = ((InvocationTargetException) e).getTargetException();
84 IStatus status = null;
85 if (e instanceof CoreException)
86 status = ((CoreException) e).getStatus();
87 else
88 status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, e.getMessage(), e);
89 log(status);
90 }
91
92 public static void logErrorMessage(String message) {
93 log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null));
94 }
95
96 /**
97 * Returns active shell.
98 */
99 public static Shell getActiveWorkbenchShell() {
100 IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
101 if (window != null) {
102 return window.getShell();
103 }
104 return null;
105 }
106
107 public static String getUniqueIdentifier() {
108 if (getDefault() == null) {
109 // If the default instance is not yet initialized,
110 // return a static identifier. This identifier must
111 // match the plugin id defined in plugin.xml
112 return PLUGIN_ID;
113 }
114 return getDefault().getBundle().getSymbolicName();
115 }
116}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java
new file mode 100644
index 0000000..de3e905
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUIElement.java
@@ -0,0 +1,161 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13public class YoctoUIElement {
14 public enum PokyMode
15 {
16 POKY_SDK_MODE,
17 POKY_TREE_MODE
18 };
19 public enum DeviceMode
20 {
21 QEMU_MODE,
22 DEVICE_MODE
23 };
24
25 private String strTarget;
26 private String[] strTargetsArray;
27 private DeviceMode enumDeviceMode;
28 private String strQemuKernelLoc;
29 private String strQemuOption;
30 private String strSysrootLoc;
31 private PokyMode enumPokyMode;
32 private String strToolChainRoot;
33 private int intTargetIndex;
34
35 public YoctoUIElement()
36 {
37 this.enumDeviceMode = DeviceMode.QEMU_MODE;
38 this.enumPokyMode = PokyMode.POKY_SDK_MODE;
39 this.strToolChainRoot = "";
40 this.strQemuKernelLoc = "";
41 this.strQemuOption = "";
42 this.strSysrootLoc = "";
43 this.intTargetIndex = -1;
44 this.strTarget = "";
45 }
46
47 public PokyMode getEnumPokyMode() {
48 return enumPokyMode;
49 }
50 public void setEnumPokyMode(PokyMode enumPokyMode) {
51 this.enumPokyMode = enumPokyMode;
52 }
53 public String getStrToolChainRoot() {
54 return strToolChainRoot;
55 }
56 public void setStrToolChainRoot(String strToolChainRoot) {
57 this.strToolChainRoot = strToolChainRoot;
58 }
59 public int getIntTargetIndex() {
60 if ((this.strTargetsArray != null) && (this.strTargetsArray.length == 1))
61 return 0;
62 return intTargetIndex;
63 }
64 public void setIntTargetIndex(int intTargetIndex) {
65 this.intTargetIndex = intTargetIndex;
66 }
67 public String getStrTarget() {
68 return strTarget;
69 }
70 public void setStrTarget(String strTarget) {
71 this.strTarget = strTarget;
72 }
73 public String[] getStrTargetsArray() {
74 return strTargetsArray;
75 }
76 public void setStrTargetsArray(String[] strTargetsArray) {
77 this.strTargetsArray = strTargetsArray;
78 }
79 public DeviceMode getEnumDeviceMode() {
80 return enumDeviceMode;
81 }
82 public void setEnumDeviceMode(DeviceMode enumDeviceMode) {
83 this.enumDeviceMode = enumDeviceMode;
84 }
85 public String getStrQemuKernelLoc() {
86 return strQemuKernelLoc;
87 }
88 public void setStrQemuKernelLoc(String strQemuKernelLoc) {
89 this.strQemuKernelLoc = strQemuKernelLoc;
90 }
91 public String getStrQemuOption() {
92 return strQemuOption;
93 }
94 public void setStrQemuOption(String strQemuOption) {
95 this.strQemuOption = strQemuOption;
96 }
97 public String getStrSysrootLoc() {
98 return strSysrootLoc;
99 }
100 public void setStrSysrootLoc(String strSysrootLoc) {
101 this.strSysrootLoc = strSysrootLoc;
102 }
103
104 @Override
105 public int hashCode() {
106 final int prime = 31;
107 int result = 1;
108 result = prime * result + ((enumDeviceMode == null) ? 0 : enumDeviceMode.hashCode());
109 result = prime * result + ((enumPokyMode == null) ? 0 : enumPokyMode.hashCode());
110 result = prime * result + intTargetIndex;
111 result = prime * result + ((strQemuKernelLoc == null) ? 0 : strQemuKernelLoc.hashCode());
112 result = prime * result + ((strQemuOption == null) ? 0 : strQemuOption.hashCode());
113 result = prime * result + ((strSysrootLoc == null) ? 0 : strSysrootLoc.hashCode());
114 result = prime * result + ((strTarget == null) ? 0 : strTarget.hashCode());
115 result = prime * result + ((strToolChainRoot == null) ? 0 : strToolChainRoot.hashCode());
116 return result;
117 }
118
119 @Override
120 public boolean equals(Object obj) {
121 if (this == obj)
122 return true;
123 if (obj == null)
124 return false;
125 if (getClass() != obj.getClass())
126 return false;
127 YoctoUIElement other = (YoctoUIElement) obj;
128 if (enumDeviceMode != other.enumDeviceMode)
129 return false;
130 if (enumPokyMode != other.enumPokyMode)
131 return false;
132 if (intTargetIndex != other.intTargetIndex)
133 return false;
134 if (strQemuKernelLoc == null) {
135 if (other.strQemuKernelLoc != null)
136 return false;
137 } else if (!strQemuKernelLoc.equals(other.strQemuKernelLoc))
138 return false;
139 if (strQemuOption == null) {
140 if (other.strQemuOption != null)
141 return false;
142 } else if (!strQemuOption.equals(other.strQemuOption))
143 return false;
144 if (strSysrootLoc == null) {
145 if (other.strSysrootLoc != null)
146 return false;
147 } else if (!strSysrootLoc.equals(other.strSysrootLoc))
148 return false;
149 if (strTarget == null) {
150 if (other.strTarget != null)
151 return false;
152 } else if (!strTarget.equals(other.strTarget))
153 return false;
154 if (strToolChainRoot == null) {
155 if (other.strToolChainRoot != null)
156 return false;
157 } else if (!strToolChainRoot.equals(other.strToolChainRoot))
158 return false;
159 return true;
160 }
161}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
new file mode 100644
index 0000000..d192538
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/YoctoUISetting.java
@@ -0,0 +1,555 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide;
12
13import java.io.File;
14import java.util.ArrayList;
15
16import org.eclipse.cdt.ui.templateengine.uitree.InputUIElement;
17import org.eclipse.core.runtime.Status;
18import org.eclipse.jface.dialogs.ErrorDialog;
19import org.eclipse.jface.preference.IPreferenceStore;
20import org.eclipse.swt.SWT;
21import org.eclipse.swt.events.ModifyEvent;
22import org.eclipse.swt.events.ModifyListener;
23import org.eclipse.swt.events.SelectionAdapter;
24import org.eclipse.swt.events.SelectionEvent;
25import org.eclipse.swt.events.SelectionListener;
26import org.eclipse.swt.layout.GridData;
27import org.eclipse.swt.layout.GridLayout;
28import org.eclipse.swt.widgets.Button;
29import org.eclipse.swt.widgets.Combo;
30import org.eclipse.swt.widgets.Composite;
31import org.eclipse.swt.widgets.Control;
32import org.eclipse.swt.widgets.DirectoryDialog;
33import org.eclipse.swt.widgets.Display;
34import org.eclipse.swt.widgets.Event;
35import org.eclipse.swt.widgets.FileDialog;
36import org.eclipse.swt.widgets.Group;
37import org.eclipse.swt.widgets.Label;
38import org.eclipse.swt.widgets.Text;
39import org.eclipse.swt.widgets.Widget;
40import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
41import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
42import org.yocto.sdk.ide.preferences.PreferenceConstants;
43
44public class YoctoUISetting {
45 private static final String ENV_SCRIPT_FILE_PREFIX = "environment-setup-";
46
47 private SelectionListener fSelectionListener;
48 private ModifyListener fModifyListener;
49 private YoctoUIElement yoctoUIElement;
50
51 private Group crossCompilerGroup;
52
53 private Button btnSDKRoot;
54 private Button btnQemu;
55 private Button btnPokyRoot;
56 private Button btnDevice;
57
58 private Button btnKernelLoc;
59 private Button btnSysrootLoc;
60 private Button btnToolChainLoc;
61
62 private Text textKernelLoc;
63 private Text textQemuOption;
64 private Text textSysrootLoc;
65 private Text textRootLoc;
66 private Combo targetArchCombo;
67
68 private Label root_label;
69 private Label sysroot_label;
70 private Label targetArchLabel;
71 private Label kernel_label;
72 private Label option_label;
73
74 public YoctoUISetting(YoctoUIElement elem)
75 {
76 yoctoUIElement = elem;
77 elem.setStrTargetsArray(getTargetArray(elem));
78
79 fSelectionListener= new SelectionListener() {
80 public void widgetDefaultSelected(SelectionEvent e) {}
81
82 public void widgetSelected(SelectionEvent e) {
83 controlChanged(e.widget);
84 relayEvent(e);
85 }
86
87 private void relayEvent(SelectionEvent e) {
88 Event event = new Event();
89 event.data = e.data;
90 event.detail = e.detail;
91 event.display = e.display;
92 event.doit = e.doit;
93 event.height = e.height;
94 event.item = e.item;
95 event.stateMask = e.stateMask;
96 event.text = e.text;
97 event.time = e.time;
98 event.widget = e.widget;
99 event.width = e.width;
100 event.x = e.x;
101 event.y = e.y;
102 crossCompilerGroup.getParent().notifyListeners(SWT.Selection, event);
103 }
104 };
105
106 fModifyListener= new ModifyListener() {
107 public void modifyText(ModifyEvent e) {
108 controlModified(e.widget);
109 relayEvent(e);
110 }
111
112 private void relayEvent(ModifyEvent e) {
113 Event event = new Event();
114 event.data = e.data;
115 event.display = e.display;
116 event.time = e.time;
117 event.widget = e.widget;
118 crossCompilerGroup.getParent().notifyListeners(SWT.Modify, event);
119 }
120 };
121 }
122
123 private Control addControls(Control fControl, final String sKey, String sValue)
124 {
125 fControl.setData(new String[]{sKey,sValue});
126 return fControl;
127 }
128
129 private Control addRadioButton(Composite parent, String label, String key, boolean bSelected) {
130 GridData gd= new GridData(SWT.FILL, SWT.CENTER, true, false);
131 String sValue;
132 Button button= new Button(parent, SWT.RADIO);
133
134 gd.horizontalSpan= 2;
135 button.setText(label);
136 button.setLayoutData(gd);
137 button.setSelection(bSelected);
138
139 if (bSelected)
140 sValue = IPreferenceStore.TRUE;
141 else
142 sValue = IPreferenceStore.FALSE;
143 return addControls((Control)button, key, sValue);
144
145 }
146
147 private Control addTextControl(final Composite parent, String key, String value) {
148 final Text text;
149
150 text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
151 text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
152 text.setText(value);
153 text.setSize(10, 150);
154
155 return addControls((Control)text, key, value);
156 }
157
158 private Button addFileSelectButton(final Composite parent, final Text text, final String key) {
159 Button button = new Button(parent, SWT.PUSH | SWT.LEAD);
160 button.setText(InputUIElement.BROWSELABEL);
161 button.addSelectionListener(new SelectionAdapter() {
162 @Override
163 public void widgetSelected(SelectionEvent event) {
164 String dirName;
165 if (key.equals(PreferenceConstants.TOOLCHAIN_ROOT)|| key.equals(PreferenceConstants.SYSROOT))
166 dirName = new DirectoryDialog(parent.getShell()).open();
167 else
168 dirName = new FileDialog(parent.getShell()).open();
169 if (dirName != null) {
170 text.setText(dirName);
171 }
172 }
173 });
174 return button;
175 }
176
177 private void createQemuSetup(final Group targetGroup)
178 {
179 //QEMU Setup
180 kernel_label= new Label(targetGroup, SWT.NONE);
181 kernel_label.setText("Kernel: ");
182 kernel_label.setAlignment(SWT.RIGHT);
183
184 Composite textContainer = new Composite(targetGroup, SWT.NONE);
185 textContainer.setLayout(new GridLayout(2, false));
186 textContainer.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
187 textKernelLoc= (Text)addTextControl(textContainer, PreferenceConstants.QEMU_KERNEL, yoctoUIElement.getStrQemuKernelLoc());
188 btnKernelLoc = addFileSelectButton(textContainer, textKernelLoc, PreferenceConstants.QEMU_KERNEL);
189
190
191 option_label = new Label(targetGroup, SWT.NONE);
192 option_label.setText("Custom Option: ");
193 option_label.setAlignment(SWT.RIGHT);
194
195 textContainer = new Composite(targetGroup, SWT.NONE);
196 textContainer.setLayout(new GridLayout(2, false));
197 textContainer.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
198 textQemuOption = (Text)addTextControl(textContainer, PreferenceConstants.QEMU_OPTION, yoctoUIElement.getStrQemuOption());
199
200/*
201 rootfs_label= new Label(targetGroup, SWT.NONE);
202 rootfs_label.setText("Root Filesystem: ");
203 rootfs_label.setAlignment(SWT.RIGHT);
204
205 textContainer = new Composite(targetGroup, SWT.NONE);
206 textContainer.setLayout(new GridLayout(2, false));
207 textContainer.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
208 textRootFSLoc= (Text)addTextControl(textContainer, PreferenceConstants.QEMU_ROOTFS, yoctoUIElement.getStrQemuRootFSLoc());
209 btnRootFSLoc = addFileSelectButton(textContainer, textRootFSLoc, PreferenceConstants.QEMU_ROOTFS);
210 */
211
212 }
213 public void createComposite(Composite composite)
214 {
215 GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
216 GridLayout layout = new GridLayout(2, false);
217
218 crossCompilerGroup = new Group(composite, SWT.NONE);
219 layout= new GridLayout(2, false);
220 crossCompilerGroup.setLayout(layout);
221 gd= new GridData(SWT.FILL, SWT.CENTER, true, false);
222 gd.horizontalSpan= 2;
223 crossCompilerGroup.setLayoutData(gd);
224 crossCompilerGroup.setText("Cross Compiler Options:");
225
226 if (yoctoUIElement.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
227
228 btnSDKRoot = (Button)addRadioButton(crossCompilerGroup, "Standalone pre-built toolchain", PreferenceConstants.SDK_MODE + "_1", true);
229 btnPokyRoot = (Button)addRadioButton(crossCompilerGroup, "Build system derived toolchain", PreferenceConstants.SDK_MODE + "_2", false);
230 }
231 else {
232 btnSDKRoot = (Button)addRadioButton(crossCompilerGroup, "Standalone pre-built toolchain", PreferenceConstants.SDK_MODE + "_1", false);
233 btnPokyRoot = (Button)addRadioButton(crossCompilerGroup, "Build system derived toolchain", PreferenceConstants.SDK_MODE + "_2", true);
234 }
235
236 root_label = new Label(crossCompilerGroup, SWT.NONE);
237 root_label.setText("Toolchain Root Location: ");
238 Composite textContainer = new Composite(crossCompilerGroup, SWT.NONE);
239 textContainer.setLayout(new GridLayout(2, false));
240 textContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
241 textRootLoc = (Text)addTextControl(textContainer,
242 PreferenceConstants.TOOLCHAIN_ROOT, yoctoUIElement.getStrToolChainRoot());
243 btnToolChainLoc = addFileSelectButton(textContainer, textRootLoc, PreferenceConstants.TOOLCHAIN_ROOT);
244
245 sysroot_label= new Label(crossCompilerGroup, SWT.NONE);
246 sysroot_label.setText("Sysroot Location: ");
247 sysroot_label.setAlignment(SWT.RIGHT);
248
249 textContainer = new Composite(crossCompilerGroup, SWT.NONE);
250 textContainer.setLayout(new GridLayout(2, false));
251 textContainer.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
252 textSysrootLoc= (Text)addTextControl(textContainer, PreferenceConstants.SYSROOT, yoctoUIElement.getStrSysrootLoc());
253 btnSysrootLoc = addFileSelectButton(textContainer, textSysrootLoc, PreferenceConstants.SYSROOT);
254
255 updateSDKControlState();
256 targetArchLabel = new Label(crossCompilerGroup, SWT.NONE);
257 targetArchLabel.setText("Target Architecture: ");
258
259 targetArchCombo= new Combo(crossCompilerGroup, SWT.READ_ONLY);
260 if (yoctoUIElement.getStrTargetsArray() != null)
261 {
262 targetArchCombo.setItems(yoctoUIElement.getStrTargetsArray());
263 targetArchCombo.select(yoctoUIElement.getIntTargetIndex());
264 }
265 targetArchCombo.setLayout(new GridLayout(2, false));
266 targetArchCombo.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
267 this.addControls((Control)targetArchCombo,
268 PreferenceConstants.TOOLCHAIN_TRIPLET, String.valueOf(yoctoUIElement.getIntTargetIndex()));
269
270
271 //Target Options
272 GridData gd2= new GridData(SWT.FILL, SWT.LEFT, true, false);
273 gd2.horizontalSpan= 2;
274 Group targetGroup= new Group(composite, SWT.NONE);
275 layout= new GridLayout();
276 layout.numColumns= 2;
277 targetGroup.setLayout(layout);
278 targetGroup.setLayoutData(gd2);
279 targetGroup.setText("Target Options:");
280
281 if (yoctoUIElement.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
282 btnQemu = (Button)addRadioButton(targetGroup, "QEMU", PreferenceConstants.TARGET_MODE + "_1", true);
283 createQemuSetup(targetGroup);
284
285 btnDevice = (Button)addRadioButton(targetGroup, "External HW", PreferenceConstants.TARGET_MODE + "_2", false);
286 }
287 else {
288 btnQemu = (Button)addRadioButton(targetGroup, "QEMU", PreferenceConstants.TARGET_MODE + "_1", false);
289 createQemuSetup(targetGroup);
290
291 btnDevice = (Button)addRadioButton(targetGroup, "External HW", PreferenceConstants.TARGET_MODE + "_2", true);
292 }
293
294 updateQemuControlState();
295
296 //we add the listener at the end for avoiding the useless event trigger when control
297 //changed or modified.
298 btnSDKRoot.addSelectionListener(fSelectionListener);
299 btnPokyRoot.addSelectionListener(fSelectionListener);
300 btnQemu.addSelectionListener(fSelectionListener);
301 btnDevice.addSelectionListener(fSelectionListener);
302 targetArchCombo.addSelectionListener(fSelectionListener);
303 textRootLoc.addModifyListener(fModifyListener);
304 textKernelLoc.addModifyListener(fModifyListener);
305 textQemuOption.addModifyListener(fModifyListener);
306 textSysrootLoc.addModifyListener(fModifyListener);
307 }
308
309 //Load all Control values into the YoctoUIElement
310 public YoctoUIElement getCurrentInput()
311 {
312 YoctoUIElement elem = new YoctoUIElement();
313 if (btnSDKRoot.getSelection())
314 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
315 else
316 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
317
318 if (btnQemu.getSelection())
319 {
320 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
321 }
322 else {
323 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
324 }
325 elem.setStrToolChainRoot(textRootLoc.getText());
326 elem.setIntTargetIndex(targetArchCombo.getSelectionIndex());
327 elem.setStrTargetsArray(targetArchCombo.getItems());
328 elem.setStrTarget(targetArchCombo.getText());
329 elem.setStrQemuKernelLoc(textKernelLoc.getText());
330 elem.setStrQemuOption(textQemuOption.getText());
331 elem.setStrSysrootLoc(textSysrootLoc.getText());
332 return elem;
333 }
334
335 public void setCurrentInput(YoctoUIElement elem){
336 elem.setStrTargetsArray(getTargetArray(elem));
337
338 btnSDKRoot.setSelection(false);
339 btnPokyRoot.setSelection(false);
340 if(elem.getEnumPokyMode().equals(YoctoUIElement.PokyMode.POKY_SDK_MODE)){
341 btnSDKRoot.setSelection(true);
342 }
343 else if(elem.getEnumPokyMode().equals(YoctoUIElement.PokyMode.POKY_TREE_MODE)){
344 btnPokyRoot.setSelection(true);
345 }
346
347 btnQemu.setSelection(false);
348 btnDevice.setSelection(false);
349 if(elem.getEnumDeviceMode().equals(YoctoUIElement.DeviceMode.QEMU_MODE)){
350 btnQemu.setSelection(true);
351 }
352 else if(elem.getEnumDeviceMode().equals(YoctoUIElement.DeviceMode.DEVICE_MODE)){
353 btnDevice.setSelection(true);
354 }
355
356 textRootLoc.setText(elem.getStrToolChainRoot());
357 targetArchCombo.select(elem.getIntTargetIndex());
358 if(elem.getStrTargetsArray() == null){
359 targetArchCombo.setItems(new String[]{});
360 }
361 else {
362 targetArchCombo.setItems(elem.getStrTargetsArray());
363 }
364 targetArchCombo.setText(elem.getStrTarget());
365 textKernelLoc.setText(elem.getStrQemuKernelLoc());
366 textQemuOption.setText(elem.getStrQemuOption());
367 textSysrootLoc.setText(elem.getStrSysrootLoc());
368 }
369
370 public SDKCheckResults validateInput(SDKCheckRequestFrom from, boolean showErrorDialog) {
371 SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(getCurrentInput());
372
373 //Show Error Message on the Label to help users.
374 if ((result != SDKCheckResults.SDK_PASS) && showErrorDialog) {
375 Display display = Display.getCurrent();
376 ErrorDialog.openError(display.getActiveShell(),
377 YoctoSDKChecker.SDKCheckRequestFrom.Other.getErrorMessage(),
378 YoctoSDKChecker.getErrorMessage(result, from),
379 new Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
380
381 }
382
383 return result;
384 }
385
386 public void setUIFormEnabledState(boolean isEnabled) {
387 btnSDKRoot.setEnabled(isEnabled);
388 btnPokyRoot.setEnabled(isEnabled);
389
390 root_label.setEnabled(isEnabled);
391 textRootLoc.setEnabled(isEnabled);
392 btnToolChainLoc.setEnabled(isEnabled);
393
394 sysroot_label.setEnabled(isEnabled);
395 textSysrootLoc.setEnabled(isEnabled);
396 btnSysrootLoc.setEnabled(isEnabled);
397
398 targetArchLabel.setEnabled(isEnabled);
399 targetArchCombo.setEnabled(isEnabled);
400
401 btnQemu.setEnabled(isEnabled);
402
403 if(isEnabled) {
404 /* enabling widgets regarding
405 * Kernel and Custom Options
406 * depends on the state of the QEMU button */
407 kernel_label.setEnabled(isEnabled);
408 option_label.setEnabled(isEnabled);
409
410 if(btnQemu.getSelection()) {
411 textKernelLoc.setEnabled(isEnabled);
412 btnKernelLoc.setEnabled(isEnabled);
413
414 textQemuOption.setEnabled(isEnabled);
415 }
416 } else {
417 /* disable all widgets regarding
418 * Kernel and Custom Options */
419 kernel_label.setEnabled(isEnabled);
420 textKernelLoc.setEnabled(isEnabled);
421 btnKernelLoc.setEnabled(isEnabled);
422
423 option_label.setEnabled(isEnabled);
424 textQemuOption.setEnabled(isEnabled);
425 }
426
427 btnDevice.setEnabled(isEnabled);
428 }
429
430 private void updateQemuControlState()
431 {
432 boolean bQemuMode = btnQemu.getSelection();
433
434 textKernelLoc.setEnabled(bQemuMode);
435 //textRootFSLoc.setEnabled(bQemuMode);
436 btnKernelLoc.setEnabled(bQemuMode);
437 //btnRootFSLoc.setEnabled(bQemuMode);
438 textQemuOption.setEnabled(bQemuMode);
439 }
440
441 private void updateSDKControlState()
442 {
443 if (btnSDKRoot.getSelection())
444 {
445 }
446 else {
447 if (!yoctoUIElement.getStrToolChainRoot().startsWith("/opt/poky"))
448 {
449 textRootLoc.setText(yoctoUIElement.getStrToolChainRoot());
450 }
451 textRootLoc.setEnabled(true);
452 btnToolChainLoc.setEnabled(true);
453 }
454 }
455
456 private void controlChanged(Widget widget) {
457
458 if (widget == btnSDKRoot || widget == btnPokyRoot)
459 {
460
461 setTargetCombo(targetArchCombo);
462 updateSDKControlState();
463 }
464
465 if (widget == btnDevice || widget == btnQemu)
466 updateQemuControlState();
467 }
468
469 private void controlModified(Widget widget) {
470 if (widget == textRootLoc)
471 {
472 setTargetCombo(targetArchCombo);
473 }
474 }
475
476 /* Search current supported Target triplet from the toolchain root
477 * by parsing ENV script file name
478 */
479 private static ArrayList<String> getTargetTripletList(String strFileName)
480 {
481 File fFile = new File(strFileName);
482 if (!fFile.exists())
483 return null;
484
485 ArrayList<String> arrTarget = new ArrayList<String>();
486 String[] strFileArray = fFile.list();
487 for (int i = 0; i < strFileArray.length; i++)
488 {
489 if (strFileArray[i].startsWith(ENV_SCRIPT_FILE_PREFIX)) {
490 arrTarget.add(strFileArray[i].substring(ENV_SCRIPT_FILE_PREFIX.length()));
491 }
492 }
493 return arrTarget;
494
495 }
496
497 private static String[] getTargetArray(YoctoUIElement elem)
498 {
499 ArrayList<String> arrTarget;
500 String sEnvFilePath = elem.getStrToolChainRoot();
501
502 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE)
503 {
504 arrTarget = getTargetTripletList(sEnvFilePath);
505 }
506 else
507 {
508 arrTarget = getTargetTripletList(sEnvFilePath + "/tmp");
509 }
510 if (arrTarget == null || arrTarget.size() <= 0)
511 return null;
512
513 String [] strTargetArray = new String[arrTarget.size()];
514 for (int i = 0; i < arrTarget.size(); i++)
515 strTargetArray[i] = arrTarget.get(i);
516
517 return strTargetArray;
518
519 }
520
521 private void setTargetCombo(Combo targetCombo)
522 {
523 YoctoUIElement elem = getCurrentInput();
524 //re-get Combo box items according to latest input!
525 elem.setStrTargetsArray(getTargetArray(elem));
526 targetCombo.removeAll();
527 if (elem.getStrTargetsArray() != null)
528 {
529 targetCombo.setItems(elem.getStrTargetsArray());
530 for (int i = 0; i < targetCombo.getItemCount(); i++)
531 {
532 if(elem.getStrTarget().equalsIgnoreCase(targetCombo.getItem(i)))
533 {
534 targetCombo.select(i);
535 return;
536 }
537 if (elem.getStrTargetsArray().length == 1)
538 targetCombo.select(0);
539 targetCombo.select(-1);
540 }
541 }
542 //prompt user,if he use tree mode, maybe he hasn't bitbake meta-ide-support yet.
543 else if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_TREE_MODE)
544 {
545 if (elem.getStrToolChainRoot().isEmpty())
546 return;
547 else {
548 File fToolChain = new File(elem.getStrToolChainRoot());
549 if (!fToolChain.exists())
550 return;
551 }
552 }
553
554 }
555}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/InvokeSyncAction.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/InvokeSyncAction.java
new file mode 100644
index 0000000..f39d5fd
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/InvokeSyncAction.java
@@ -0,0 +1,110 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.actions;
12
13import java.io.IOException;
14import java.io.OutputStream;
15import java.util.ArrayList;
16
17import org.eclipse.cdt.core.CommandLauncher;
18import org.eclipse.cdt.core.ConsoleOutputStream;
19import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
20import org.eclipse.cdt.core.resources.IConsole;
21import org.eclipse.cdt.managedbuilder.core.IConfiguration;
22import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
23import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
24import org.eclipse.core.resources.IProject;
25import org.eclipse.core.runtime.CoreException;
26import org.eclipse.core.runtime.IPath;
27import org.eclipse.core.runtime.NullProgressMonitor;
28import org.eclipse.core.runtime.Path;
29import org.eclipse.cdt.internal.autotools.core.AutotoolsNewMakeGenerator;
30import org.eclipse.cdt.internal.autotools.ui.actions.InvokeAction;
31import org.eclipse.cdt.internal.autotools.ui.actions.InvokeMessages;
32
33import org.yocto.sdk.ide.YoctoSDKPlugin;
34
35@SuppressWarnings("restriction")
36public class InvokeSyncAction extends InvokeAction {
37 protected void executeLocalConsoleCommand(final IConsole console, final String actionName, final String command,
38 final String[] argumentList, final IPath execDir, final String password) throws CoreException, IOException {
39
40 String errMsg = null;
41 IProject project = getSelectedContainer().getProject();
42 // Get a build console for the project
43 ConsoleOutputStream consoleOutStream = console.getOutputStream();
44 // FIXME: we want to remove need for ManagedBuilderManager, but how do we
45 // get environment variables.
46 IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
47 IConfiguration cfg = info.getDefaultConfiguration();
48
49 StringBuffer buf = new StringBuffer();
50 String[] consoleHeader = new String[3];
51
52 consoleHeader[0] = actionName;
53 consoleHeader[1] = cfg.getName();
54 consoleHeader[2] = project.getName();
55 buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
56 String invokeMsg = InvokeMessages.getFormattedString("InvokeAction.console.message", //$NON-NLS-1$
57 new String[]{actionName, execDir.toString()}); //$NON-NLS-1$
58 buf.append(invokeMsg);
59 buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
60 buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
61 consoleOutStream.write(buf.toString().getBytes());
62 consoleOutStream.flush();
63
64 ArrayList<String> additionalEnvs = new ArrayList<String>();
65 String strippedCommand = AutotoolsNewMakeGenerator.stripEnvVars(command, additionalEnvs);
66 // Get a launcher for the config command
67 CommandLauncher launcher = new CommandLauncher();
68 // Set the environment
69 IEnvironmentVariable variables[] = ManagedBuildManager
70 .getEnvironmentVariableProvider().getVariables(cfg, true);
71 String[] env = null;
72 ArrayList<String> envList = new ArrayList<String>();
73 if (variables != null) {
74 for (int i = 0; i < variables.length; i++) {
75 envList.add(variables[i].getName()
76 + "=" + variables[i].getValue()); //$NON-NLS-1$
77 }
78 // add any additional environment variables specified ahead of script
79 if (additionalEnvs.size() > 0)
80 envList.addAll(additionalEnvs);
81 env = (String[]) envList.toArray(new String[envList.size()]);
82 }
83 OutputStream stdout = consoleOutStream;
84 OutputStream stderr = consoleOutStream;
85
86 launcher.showCommand(true);
87 // Run the shell script via shell command.
88 Process proc = launcher.execute(new Path(strippedCommand), argumentList, env,
89 execDir, new NullProgressMonitor());
90
91 if (proc != null) {
92 // Close the input of the process since we will never write to it
93 OutputStream out = proc.getOutputStream();
94 if (!password.isEmpty()) {
95 out.write(password.getBytes());
96 out.write("\n".getBytes());
97 }
98 out.close();
99
100 if (launcher.waitAndRead(stdout, stderr) != CommandLauncher.OK) {
101 errMsg = launcher.getErrorMessage();
102 }
103 } else {
104 errMsg = launcher.getErrorMessage();
105 }
106
107 if (errMsg != null)
108 YoctoSDKPlugin.logErrorMessage(errMsg);
109 }
110}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
new file mode 100644
index 0000000..e3e7e60
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ProfileSwitchHandler.java
@@ -0,0 +1,134 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.actions;
12
13import java.util.Map;
14
15import org.eclipse.cdt.core.model.ICElement;
16import org.eclipse.cdt.core.model.ICProject;
17import org.eclipse.core.commands.AbstractHandler;
18import org.eclipse.core.commands.Command;
19import org.eclipse.core.commands.ExecutionEvent;
20import org.eclipse.core.commands.ExecutionException;
21import org.eclipse.core.commands.State;
22import org.eclipse.core.resources.IProject;
23import org.eclipse.core.resources.IResource;
24import org.eclipse.core.runtime.IAdaptable;
25import org.eclipse.core.runtime.Status;
26import org.eclipse.jface.dialogs.ErrorDialog;
27import org.eclipse.jface.preference.IPreferenceStore;
28import org.eclipse.jface.viewers.ISelection;
29import org.eclipse.jface.viewers.ITreeSelection;
30import org.eclipse.swt.widgets.Display;
31import org.eclipse.ui.commands.ICommandService;
32import org.eclipse.ui.commands.IElementUpdater;
33import org.eclipse.ui.handlers.HandlerUtil;
34import org.eclipse.ui.handlers.RadioState;
35import org.eclipse.ui.menus.UIElement;
36import org.yocto.sdk.ide.YoctoProfileElement;
37import org.yocto.sdk.ide.YoctoSDKChecker;
38import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
39import org.yocto.sdk.ide.YoctoSDKMessages;
40import org.yocto.sdk.ide.YoctoSDKPlugin;
41import org.yocto.sdk.ide.YoctoUIElement;
42import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
43import org.yocto.sdk.ide.utils.YoctoSDKUtils;
44
45public class ProfileSwitchHandler extends AbstractHandler implements IElementUpdater {
46 private static final String PROJECT_SPECIFIC_ERROR = "Preferences.Profile.ProjectSpecific.Error.Title";
47 private static final String PROJECT_SPECIFIC_ERROR_MESSAGE = "Preferences.Profile.ProjectSpecific.Error.Message";
48
49 public static final String PROFILE_SWITCH_COMMAND = "org.yocto.sdk.ide.targetProfile.switch"; //$NON-NLS-N$
50 public static final String PROJECT_SPECIFIC_PARAMETER = "##PROJECT_SPECIFIC_PROFILE##"; //$NON-NLS-N$
51
52 @Override
53 public Object execute(ExecutionEvent event) throws ExecutionException {
54 if(HandlerUtil.matchesRadioState(event)) {
55 return null;
56 }
57
58 String currentState = event.getParameter(RadioState.PARAMETER_ID);
59 HandlerUtil.updateRadioState(event.getCommand(), currentState);
60
61 switchProfile(getSelectedProject(event), currentState);
62
63 return null;
64 }
65
66 public IProject getSelectedProject(ExecutionEvent event) {
67 ISelection selection = HandlerUtil.getCurrentSelection(event);
68
69 if (selection instanceof ITreeSelection) {
70 Object selectedItem = ((ITreeSelection) selection).getFirstElement();
71 if (selectedItem instanceof IResource) {
72 return ((IResource) selectedItem).getProject();
73 } else if (selectedItem instanceof ICElement) {
74 ICProject cProject = ((ICElement) selectedItem).getCProject();
75 if (cProject != null) {
76 return cProject.getProject();
77 }
78 } else if (selectedItem instanceof IAdaptable) {
79 Object projectObject = ((IAdaptable) selectedItem).getAdapter(IProject.class);
80 if (projectObject != null && projectObject instanceof IProject) {
81 return ((IProject) projectObject);
82 }
83 }
84 }
85
86 return null;
87 }
88
89 private void switchProfile(IProject project, String selectedProfile) {
90 if (PROJECT_SPECIFIC_PARAMETER.equals(selectedProfile)) {
91 YoctoUIElement yoctoUIElement = ProjectPreferenceUtils.getElem(project);
92 SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(yoctoUIElement);
93
94 if ((result != SDKCheckResults.SDK_PASS)) {
95 Display display = Display.getCurrent();
96 ErrorDialog.openError(display.getActiveShell(),
97 YoctoSDKMessages.getString(PROJECT_SPECIFIC_ERROR),
98 YoctoSDKMessages.getFormattedString(PROJECT_SPECIFIC_ERROR_MESSAGE,
99 project.getName()),
100 new Status(Status.ERROR, YoctoSDKPlugin.PLUGIN_ID, result.getMessage()));
101 return;
102 }
103
104 ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUIElement, project);
105 ProjectPreferenceUtils.saveUseProjectSpecificOption(project, true);
106 } else {
107 IPreferenceStore store = YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile);
108 YoctoUIElement yoctoUIElement = YoctoSDKUtils.getElemFromStore(store);
109 ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUIElement, project);
110 ProjectPreferenceUtils.saveUseProjectSpecificOption(project, false);
111
112 YoctoProfileElement profileSettings = ProjectPreferenceUtils.getProfiles(project);
113 profileSettings.setSelectedProfile(selectedProfile);
114 ProjectPreferenceUtils.saveProfiles(profileSettings, project);
115 }
116 }
117
118 /*
119 * Workaround for BUG 398647 to allow checking radio items
120 * in a dynamic contribution
121 *
122 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=398647
123 */
124 @Override
125 public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
126 ICommandService service = (ICommandService) element.getServiceLocator().getService(ICommandService.class);
127 String state = (String) parameters.get(RadioState.PARAMETER_ID);
128 Command command = service.getCommand(PROFILE_SWITCH_COMMAND);
129 State commandState = command.getState(RadioState.STATE_ID);
130 if (commandState.getValue().equals(state)) {
131 element.setChecked(true);
132 }
133 }
134}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoAction.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoAction.java
new file mode 100644
index 0000000..e255fd1
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoAction.java
@@ -0,0 +1,44 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.actions;
12
13import org.eclipse.cdt.internal.autotools.ui.actions.InvokeAction;
14import org.eclipse.core.resources.IContainer;
15import org.eclipse.core.resources.IProject;
16import org.eclipse.jface.action.IAction;
17import org.eclipse.jface.preference.PreferenceDialog;
18import org.eclipse.ui.dialogs.PreferencesUtil;
19import org.yocto.sdk.ide.YoctoSDKPlugin;
20
21
22@SuppressWarnings("restriction")
23public class ReconfigYoctoAction extends InvokeAction {
24
25 public void run(IAction action) {
26 IContainer container = getSelectedContainer();
27 if (container == null)
28 return;
29
30 IProject project = container.getProject();
31
32 PreferenceDialog dialog =
33 PreferencesUtil.createPropertyDialogOn(YoctoSDKPlugin.getActiveWorkbenchShell(),
34 project,
35 "org.yocto.sdk.ide.page",
36 null,
37 null);
38 dialog.open();
39 }
40
41 public void dispose() {
42
43 }
44}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoHandler.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoHandler.java
new file mode 100644
index 0000000..6d508d3
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/ReconfigYoctoHandler.java
@@ -0,0 +1,78 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.actions;
12
13import java.lang.reflect.Method;
14
15import org.eclipse.core.commands.ExecutionEvent;
16import org.eclipse.core.commands.ExecutionException;
17import org.eclipse.core.expressions.IEvaluationContext;
18import org.eclipse.core.resources.IContainer;
19import org.eclipse.core.runtime.IStatus;
20import org.eclipse.core.runtime.Status;
21import org.eclipse.jface.dialogs.ErrorDialog;
22import org.eclipse.cdt.internal.autotools.ui.actions.AbstractAutotoolsHandler;
23import org.eclipse.cdt.internal.autotools.ui.actions.InvokeAction;
24import org.eclipse.swt.widgets.Display;
25import org.yocto.sdk.ide.YoctoSDKPlugin;
26
27
28@SuppressWarnings("restriction")
29public class ReconfigYoctoHandler extends AbstractAutotoolsHandler {
30
31 public Object execute(ExecutionEvent event) throws ExecutionException {
32 ReconfigYoctoAction action = new ReconfigYoctoAction();
33 Method method = null;
34
35 try {
36 /*
37 * This is hack to workaround upstream eclipse bug #370288
38 */
39 Class [] params = {ExecutionEvent.class, InvokeAction.class};
40 method = AbstractAutotoolsHandler.class.getDeclaredMethod("execute",params );
41 } catch (NoSuchMethodException e) {
42 //no such method, old version of plugin org.eclipse.linuxtools.autotools.ui
43 method = null;
44 } catch (Exception e) {
45 throw new ExecutionException(e.getMessage(), e);
46 }
47
48 if (method != null) {
49 //new version
50 Object [] params = {event, action};
51 try {
52 return method.invoke(this, params);
53 }catch (Exception e) {
54 throw new ExecutionException(e.getMessage(), e);
55 }
56 } else {
57 //old version
58 //display a dialog to warn the user
59 Display.getDefault().syncExec(new Runnable() {
60 public void run() {
61 ErrorDialog.openError(null, "Change Yocto Project Settings", "Please update the plugin of \"Autotools support for CDT\"!",
62 new Status(IStatus.WARNING,YoctoSDKPlugin.PLUGIN_ID,"old version of plugin \"Autotools support for CDT\" detected."));
63 }
64 });
65 //try to display the dialog in the old way
66 Object o = event.getApplicationContext();
67 if (o instanceof IEvaluationContext) {
68 IContainer container = getContainer((IEvaluationContext)o);
69 if (container != null) {
70 action.setSelectedContainer(container);
71 action.run(null);
72 }
73 }
74 }
75
76 return null;
77 }
78}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/YoctoConsole.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/YoctoConsole.java
new file mode 100644
index 0000000..4b25d94
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/actions/YoctoConsole.java
@@ -0,0 +1,24 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.actions;
12
13import org.eclipse.cdt.internal.autotools.ui.Console;
14import org.yocto.sdk.ide.YoctoSDKMessages;
15
16@SuppressWarnings("restriction")
17public class YoctoConsole extends Console {
18 private static final String CONTEXT_MENU_ID = "YoctoConsole";
19 private static final String CONSOLE_NAME = YoctoSDKMessages.getString("Console.SDK.Name");
20
21 public YoctoConsole() {
22 super(CONSOLE_NAME, CONTEXT_MENU_ID);
23 }
24}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
new file mode 100644
index 0000000..ce80d77
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKAutotoolsProjectNature.java
@@ -0,0 +1,79 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.natures;
12
13import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
14import org.eclipse.cdt.internal.autotools.core.configure.IAConfiguration;
15import org.eclipse.cdt.managedbuilder.core.IConfiguration;
16import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
17import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
18import org.eclipse.core.resources.IProject;
19import org.yocto.sdk.ide.YoctoSDKPlugin;
20import org.yocto.sdk.ide.YoctoUIElement;
21import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
22import org.yocto.sdk.ide.utils.YoctoSDKUtils;
23
24public class YoctoSDKAutotoolsProjectNature extends YoctoSDKProjectNature {
25 public static final String YoctoSDK_AUTOTOOLS_NATURE_ID = YoctoSDKPlugin.getUniqueIdentifier() + ".YoctoSDKAutotoolsNature";
26
27 private static final String DEFAULT_HOST_STR = "host";
28 private static final String DEFAULT_TARGET_STR = "target";
29 private static final String DEFAULT_BUILD_STR = "build";
30 private static final String DEFAULT_AUTOGEN_OPT_STR = "autogenOpts";
31
32 private static final String DEFAULT_CONFIGURE_STR = "configure";
33 private static final String DEFAULT_AUTOGEN_STR = "autogen";
34 private static final String DEFAULT_LIBTOOL_SYSROOT_PREFIX = " --with-libtool-sysroot=";
35
36 public static void configureAutotoolsOptions(IProject project) {
37 IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
38 IConfiguration icfg = info.getDefaultConfiguration();
39 YoctoUIElement elem = ProjectPreferenceUtils.getElemFromProjectEnv(project);
40 String sysroot_str = elem.getStrSysrootLoc();
41 String id = icfg.getId();
42 String CFLAGS_str = YoctoSDKUtils.getEnvValue(project, "CFLAGS");
43 String CXXFLAGS_str = YoctoSDKUtils.getEnvValue(project, "CXXFLAGS");
44 String CPPFLAGS_str = YoctoSDKUtils.getEnvValue(project, "CPPFLAGS");
45 String LDFLAGS_str = YoctoSDKUtils.getEnvValue(project, "LDFLAGS");
46
47 String command_prefix = "CFLAGS=\" -g -O0 " + CFLAGS_str + "\" CXXFLAGS=\" -g -O0 "
48 + CXXFLAGS_str + "\" LDFLAGS=\"" + LDFLAGS_str + "\" CPPFLAGS=\"" + CPPFLAGS_str + "\"";
49 String autogen_setting = command_prefix+" autogen.sh" + DEFAULT_LIBTOOL_SYSROOT_PREFIX + sysroot_str;
50 String configure_setting = command_prefix + " configure" + DEFAULT_LIBTOOL_SYSROOT_PREFIX + sysroot_str;
51 IAConfiguration cfg = AutotoolsConfigurationManager.getInstance().getConfiguration(project, id);
52 String strConfigure = YoctoSDKUtils.getEnvValue(project, "CONFIGURE_FLAGS");
53
54 cfg.setOption(DEFAULT_CONFIGURE_STR, configure_setting);
55 cfg.setOption(DEFAULT_BUILD_STR, splitString(strConfigure, "--build="));
56 cfg.setOption(DEFAULT_HOST_STR, splitString(strConfigure, "--host="));
57 cfg.setOption(DEFAULT_TARGET_STR, splitString(strConfigure, "--target="));
58 cfg.setOption(DEFAULT_AUTOGEN_STR, autogen_setting);
59 cfg.setOption(DEFAULT_AUTOGEN_OPT_STR, strConfigure);
60
61 AutotoolsConfigurationManager.getInstance().addConfiguration(project, cfg);
62 AutotoolsConfigurationManager.getInstance().saveConfigs(project);
63 }
64
65 private static String splitString(String strValue, String strDelim) {
66 int iBeginIndex = strValue.indexOf(strDelim);
67
68 if (iBeginIndex < 0) {
69 return "";
70 }
71 int iEndIndex = strValue.indexOf(' ', iBeginIndex + 1);
72
73 if (iEndIndex < 0) {
74 return strValue.substring(iBeginIndex + strDelim.length());
75 } else {
76 return strValue.substring(iBeginIndex + strDelim.length(), iEndIndex);
77 }
78 }
79}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKCMakeProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKCMakeProjectNature.java
new file mode 100644
index 0000000..b3d0f2c
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKCMakeProjectNature.java
@@ -0,0 +1,92 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.natures;
12
13import org.eclipse.cdt.core.CCorePlugin;
14import org.eclipse.cdt.core.envvar.IContributedEnvironment;
15import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
16import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
17import org.eclipse.cdt.core.model.CoreModel;
18import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
19import org.eclipse.cdt.core.settings.model.ICProjectDescription;
20import org.eclipse.core.resources.IProject;
21import org.eclipse.core.runtime.CoreException;
22import org.yocto.sdk.ide.YoctoSDKPlugin;
23import org.yocto.sdk.ide.utils.YoctoSDKUtils;
24
25public class YoctoSDKCMakeProjectNature extends YoctoSDKProjectNature {
26 public static final String YoctoSDK_CMAKE_NATURE_ID = YoctoSDKPlugin.getUniqueIdentifier() + ".YoctoSDKCMakeNature";
27
28 // Considered poky's cmake.bbclass for this method
29 public static void extendProjectEnvironmentForCMake(IProject project) {
30 ICProjectDescription cpdesc = CoreModel.getDefault().getProjectDescription(project, true);
31 ICConfigurationDescription ccdesc = cpdesc.getActiveConfiguration();
32 IEnvironmentVariableManager manager = CCorePlugin.getDefault().getBuildEnvironmentManager();
33 IContributedEnvironment env = manager.getContributedEnvironment();
34 String delimiter = manager.getDefaultDelimiter();
35
36 env.addVariable("CCACHE", "", IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
37
38 env.addVariable("OECMAKE_SOURCEPATH", "..",
39 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
40
41 String oecmakeBuildPathString = "";
42 env.addVariable("OECMAKE_BUILDPATH", oecmakeBuildPathString,
43 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
44 env.addVariable("EXTRA_OEMAKE", "-C " + oecmakeBuildPathString,
45 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
46
47 String ccString = YoctoSDKUtils.getEnvValue(project, "CC");
48
49 if (!ccString.equals("") && !ccString.equals(" ")) {
50 ccString.trim();
51 ccString = ccString.split(" ")[0];
52 }
53
54 env.addVariable("OECMAKE_C_COMPILER", ccString,
55 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
56 String cxxString = YoctoSDKUtils.getEnvValue(project, "CXX");
57
58 if (!cxxString.equals("") && !cxxString.equals(" ")) {
59 cxxString.trim();
60 cxxString = cxxString.split(" ")[0];
61 }
62
63 env.addVariable("OECMAKE_CXX_COMPILER", cxxString,
64 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
65
66 String hostCCArchString = YoctoSDKUtils.getEnvValue(project, "HOST_CC_ARCH");
67 String toolchainOptionsString = YoctoSDKUtils.getEnvValue(project, "TOOLCHAIN_OPTIONS");
68 String cppFlagsString = YoctoSDKUtils.getEnvValue(project, "CPPFLAGS");
69 String cxxFlagsString = YoctoSDKUtils.getEnvValue(project, "CXXFLAGS");
70 String selectedOptimizationString = YoctoSDKUtils.getEnvValue(project, "SELECTED_OPTIMIZATION");
71 env.addVariable("OECMAKE_C_FLAGS", hostCCArchString + " " + toolchainOptionsString + " " + cppFlagsString,
72 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
73 env.addVariable("OECMAKE_CXX_FLAGS", hostCCArchString + " " + toolchainOptionsString + " " + cxxFlagsString
74 + " -fpermissive",
75 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
76 env.addVariable("OECMAKE_C_FLAGS_RELEASE", selectedOptimizationString + " " + cppFlagsString + " -DNDEBUG",
77 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
78 env.addVariable("OECMAKE_CXX_FLAGS_RELEASE", selectedOptimizationString + " " + cxxFlagsString + " -DNDEBUG",
79 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
80
81 env.addVariable("OECMAKE_RPATH", "",
82 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
83 env.addVariable("OECMAKE_PERLNATIVE_DIR", "",
84 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
85
86 try {
87 CoreModel.getDefault().setProjectDescription(project, cpdesc);
88 } catch (CoreException e) {
89 e.printStackTrace();
90 }
91 }
92}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKEmptyProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKEmptyProjectNature.java
new file mode 100644
index 0000000..e1b847a
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKEmptyProjectNature.java
@@ -0,0 +1,8 @@
1package org.yocto.sdk.ide.natures;
2
3import org.yocto.sdk.ide.YoctoSDKPlugin;
4
5public class YoctoSDKEmptyProjectNature extends YoctoSDKProjectNature {
6
7 public static final String YoctoSDK_EMPTY_NATURE_ID = YoctoSDKPlugin.getUniqueIdentifier() + ".YoctoSDKEmptyNature";
8}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKNatureUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKNatureUtils.java
new file mode 100644
index 0000000..5a2a6b1
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKNatureUtils.java
@@ -0,0 +1,39 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 * BMW Car IT - extracted in an own class
11 *******************************************************************************/
12package org.yocto.sdk.ide.natures;
13
14import org.eclipse.core.resources.IProject;
15import org.eclipse.core.resources.IProjectDescription;
16import org.eclipse.core.runtime.CoreException;
17import org.eclipse.core.runtime.IProgressMonitor;
18
19public class YoctoSDKNatureUtils {
20
21 public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException
22 {
23 IProjectDescription description = project.getDescription();
24 String[] natures = description.getNatureIds();
25
26 for (int i = 0; i < natures.length; ++i) {
27 if (natureId.equals(natures[i]))
28 return;
29 }
30
31 String[] newNatures = new String[natures.length + 1];
32 System.arraycopy(natures, 0, newNatures, 0, natures.length);
33 newNatures[natures.length] = natureId;
34 description.setNatureIds(newNatures);
35 project.setDescription(description, monitor);
36
37 }
38
39}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKProjectNature.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKProjectNature.java
new file mode 100644
index 0000000..e3f6a35
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/natures/YoctoSDKProjectNature.java
@@ -0,0 +1,36 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.natures;
12
13import org.eclipse.core.resources.IProject;
14import org.eclipse.core.resources.IProjectNature;
15import org.eclipse.core.runtime.CoreException;
16import org.yocto.sdk.ide.YoctoSDKPlugin;
17
18public class YoctoSDKProjectNature implements IProjectNature {
19 public static final String YoctoSDK_NATURE_ID = YoctoSDKPlugin.getUniqueIdentifier() + ".YoctoSDKNature";
20
21 private IProject proj;
22
23 public void configure() throws CoreException {
24 }
25
26 public void deconfigure() throws CoreException {
27 }
28
29 public IProject getProject() {
30 return proj;
31 }
32
33 public void setProject(IProject project) {
34 this.proj = project;
35 }
36}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java
new file mode 100644
index 0000000..0ebbe99
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceConstants.java
@@ -0,0 +1,43 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.preferences;
12
13/**
14 * Constant definitions for plug-in preferences
15 */
16public class PreferenceConstants {
17
18 public static final String TOOLCHAIN_ROOT = "toolChainRoot";
19
20 public static final String TARGET_MODE = "TargetMode";
21
22 public static final String SDK_MODE = "SDKMode";
23
24 public static final String TARGET_ARCH_INDEX = "targeArchIndex";
25
26 public static final String TOOLCHAIN_TRIPLET = "toolchainTriplet";
27
28 public static final String QEMU_KERNEL = "QemuKernel";
29
30 public static final String QEMU_OPTION = "QemuOption";
31
32 public static final String SYSROOT = "Sysroot";
33
34 public static final String IP_ADDR = "IPAddr";
35
36 public static final String STANDARD_PROFILE_NAME = "Standard Profile";
37
38 public static final String PROFILES = "profiles";
39
40 public static final String SELECTED_PROFILE = "selectedProfile";
41
42 public static final String PROJECT_SPECIFIC_PROFILE = "##PROJECT_SPECIFIC_PROFILE##";
43}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceInitializer.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000..40f37d0
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/PreferenceInitializer.java
@@ -0,0 +1,44 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.preferences;
12
13import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
14import org.eclipse.jface.preference.IPreferenceStore;
15
16import org.yocto.sdk.ide.YoctoSDKPlugin;
17
18import static org.yocto.sdk.ide.preferences.PreferenceConstants.*;
19
20/**
21 * Class used to initialize default preference values.
22 */
23public class PreferenceInitializer extends AbstractPreferenceInitializer {
24 /*
25 * (non-Javadoc)
26 *
27 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
28 */
29 public void initializeDefaultPreferences() {
30 IPreferenceStore store = YoctoSDKPlugin.getDefault().getPreferenceStore();
31 store.setDefault(TOOLCHAIN_ROOT, "");
32 store.setDefault(SDK_MODE, true);
33 store.setDefault(TARGET_MODE, false);
34 store.setDefault(TARGET_ARCH_INDEX, -1);
35 store.setDefault(IP_ADDR, "");
36 store.setDefault(QEMU_KERNEL, "");
37 store.setDefault(QEMU_OPTION, "");
38 store.setDefault(SYSROOT, "");
39 store.setDefault(TOOLCHAIN_TRIPLET, "");
40 store.setDefault(PROFILES, "\"" + STANDARD_PROFILE_NAME + "\"");
41 store.setDefault(SELECTED_PROFILE, STANDARD_PROFILE_NAME);
42 }
43
44}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java
new file mode 100644
index 0000000..38e38b1
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/ProfileNameInputValidator.java
@@ -0,0 +1,63 @@
1/*******************************************************************************
2 * Copyright (c) 2012 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.preferences;
12
13import org.eclipse.jface.dialogs.IInputValidator;
14import org.yocto.sdk.ide.YoctoProfileElement;
15import org.yocto.sdk.ide.YoctoSDKMessages;
16
17public class ProfileNameInputValidator implements IInputValidator {
18 private static final String WARNING_CONTAINS_COMMA = "Preferences.Profile.Validator.InvalidName.Comma";
19 private static final String WARNING_CONTAINS_DOUBLEQUOTE = "Preferences.Profile.Validator.InvalidName.Quote";
20 private static final String PROFILE_NAME_IS_EMPTY = "Preferences.Profile.Validator.InvalidName.Empty";
21 private static final String WARNING_ALREADY_EXISTS = "Preferences.Profile.Validator.InvalidName.Exists";
22
23 private final String selectedItem;
24 private final YoctoProfileElement profileSetting;
25
26 public ProfileNameInputValidator(YoctoProfileElement profileSetting) {
27 this(profileSetting, "");
28 }
29
30 public ProfileNameInputValidator(YoctoProfileElement profileSetting, String selectedItem) {
31 this.selectedItem = selectedItem;
32 this.profileSetting = profileSetting;
33 }
34
35 @Override
36 public String isValid(String newText) {
37 if (newText.contains(",")) {
38 return YoctoSDKMessages.getString(WARNING_CONTAINS_COMMA);
39 }
40
41 if (newText.contains("\"")) {
42 return YoctoSDKMessages.getString(WARNING_CONTAINS_DOUBLEQUOTE);
43 }
44
45 if (newText.isEmpty()) {
46 return YoctoSDKMessages.getString(PROFILE_NAME_IS_EMPTY);
47 }
48
49 if (selectedItemEquals(newText)) {
50 return null;
51 }
52
53 if (profileSetting.contains(newText)) {
54 return YoctoSDKMessages.getString(WARNING_ALREADY_EXISTS);
55 }
56
57 return null;
58 }
59
60 private boolean selectedItemEquals(String newText) {
61 return !selectedItem.isEmpty() && newText.equals(selectedItem);
62 }
63}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
new file mode 100644
index 0000000..4e6ca2a
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKPreferencePage.java
@@ -0,0 +1,307 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.preferences;
12
13import java.util.HashSet;
14
15import org.eclipse.core.resources.IProject;
16import org.eclipse.core.resources.ResourcesPlugin;
17import org.eclipse.core.runtime.CoreException;
18import org.eclipse.jface.dialogs.Dialog;
19import org.eclipse.jface.dialogs.IDialogConstants;
20import org.eclipse.jface.dialogs.InputDialog;
21import org.eclipse.jface.dialogs.MessageDialog;
22import org.eclipse.jface.preference.IPreferenceStore;
23import org.eclipse.jface.preference.PreferencePage;
24import org.eclipse.swt.SWT;
25import org.eclipse.swt.layout.GridLayout;
26import org.eclipse.swt.widgets.Composite;
27import org.eclipse.swt.widgets.Control;
28import org.eclipse.swt.widgets.Event;
29import org.eclipse.swt.widgets.Listener;
30import org.eclipse.ui.IWorkbench;
31import org.eclipse.ui.IWorkbenchPreferencePage;
32import org.yocto.sdk.ide.YoctoProfileElement;
33import org.yocto.sdk.ide.YoctoProfileSetting;
34import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
35import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
36import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
37import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
38import org.yocto.sdk.ide.utils.YoctoSDKUtils;
39import org.yocto.sdk.ide.YoctoSDKMessages;
40import org.yocto.sdk.ide.YoctoSDKPlugin;
41import org.yocto.sdk.ide.YoctoUIElement;
42import org.yocto.sdk.ide.YoctoUISetting;
43
44public class YoctoSDKPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
45
46 private static final String NEW_DIALOG_TITLE = "Preferences.Profile.New.Dialog.Title";
47 private static final String NEW_DIALOG_MESSAGE = "Preferences.Profile.New.Dialog.Message";
48 private static final String UPDATE_DIALOG_TITLE = "Preferences.Profile.Update.Dialog.Title";
49 private static final String UPDATE_DIALOG_MESSAGE = "Preferences.Profile.Update.Dialog.Message";
50 private static final String REVALIDATION_MESSAGE = "Poky.SDK.Revalidation.Message";
51
52 private YoctoProfileSetting yoctoProfileSetting;
53 private YoctoUISetting yoctoUISetting;
54
55 private Listener changeListener;
56
57 public YoctoSDKPreferencePage() {
58 //super(GRID);
59 IPreferenceStore defaultStore = YoctoSDKPlugin.getDefault().getPreferenceStore();
60 String profiles = defaultStore.getString(PreferenceConstants.PROFILES);
61 String selectedProfile = defaultStore.getString(PreferenceConstants.SELECTED_PROFILE);
62
63 if (profiles.isEmpty()) {
64 profiles = defaultStore.getDefaultString(PreferenceConstants.PROFILES);
65 selectedProfile = defaultStore.getDefaultString(PreferenceConstants.SELECTED_PROFILE);
66 }
67
68 setPreferenceStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile));
69 //setDescription(YoctoSDKMessages.getString(PREFERENCES_Yocto_CONFIG));
70 YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
71 this.yoctoUISetting = new YoctoUISetting(elem);
72
73 YoctoProfileElement profileElement = new YoctoProfileElement(profiles, selectedProfile);
74 this.yoctoProfileSetting = new YoctoProfileSetting(profileElement, this, true);
75
76 changeListener = new Listener() {
77 @Override
78 public void handleEvent(Event event) {
79 setErrorMessage(null);
80 setMessage(YoctoSDKMessages.getString(REVALIDATION_MESSAGE), INFORMATION);
81 }
82 };
83 }
84
85 /*
86 * @see IWorkbenchPreferencePage#init(IWorkbench)
87 */
88 public void init(IWorkbench workbench) {
89 }
90
91 protected Control createContents(Composite parent) {
92 initializeDialogUnits(parent);
93 final Composite composite= new Composite(parent, SWT.NONE);
94 composite.setLayout(new GridLayout(2, false));
95
96 yoctoProfileSetting.createComposite(composite);
97 yoctoUISetting.createComposite(composite);
98
99 composite.addListener(SWT.Modify, changeListener);
100 composite.addListener(SWT.Selection, changeListener);
101
102 SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
103 if (result != SDKCheckResults.SDK_PASS) {
104 }
105
106 Dialog.applyDialogFont(composite);
107 return composite;
108 }
109
110 /*
111 * @see IPreferencePage#performOk()
112 */
113 public boolean performOk() {
114 clearMessages();
115
116 SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
117 if (result != SDKCheckResults.SDK_PASS) {
118 setErrorMessage(result.getMessage());
119 return false;
120 }
121
122 YoctoUIElement savedElement = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
123 YoctoUIElement modifiedElement = yoctoUISetting.getCurrentInput();
124
125 YoctoProfileElement savedProfileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
126 YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
127
128 if (savedElement.equals(modifiedElement) &&
129 profileElement.getSelectedProfile().equals(savedProfileElement.getSelectedProfile())) {
130 return true;
131 }
132
133 HashSet<IProject> yoctoProjects = getAffectedProjects(profileElement.getSelectedProfile());
134
135 if (!yoctoProjects.isEmpty()) {
136 boolean deleteConfirmed =
137 MessageDialog.openConfirm(null, YoctoSDKMessages.getString(UPDATE_DIALOG_TITLE),
138 YoctoSDKMessages.getFormattedString(UPDATE_DIALOG_MESSAGE, profileElement.getSelectedProfile()));
139
140 if (!deleteConfirmed) {
141 return false;
142 }
143 }
144
145 saveElemToStore(modifiedElement, getPreferenceStore());
146 YoctoSDKUtils.saveProfilesToDefaultStore(profileElement);
147
148 updateProjects(yoctoProjects, modifiedElement);
149
150 return super.performOk();
151 }
152
153 private void clearMessages() {
154 setErrorMessage(null);
155 setMessage(null);
156 setTitle(getTitle());
157 }
158
159 /*
160 * @see PreferencePage#performDefaults()
161 */
162 protected void performDefaults() {
163 YoctoUIElement defaultElement = YoctoSDKUtils.getDefaultElemFromDefaultStore();
164 yoctoUISetting.setCurrentInput(defaultElement);
165 super.performDefaults();
166 }
167
168 public void performSaveAs() {
169 YoctoProfileElement profileElement = yoctoProfileSetting.getCurrentInput();
170 YoctoUIElement uiElement = yoctoUISetting.getCurrentInput();
171
172 SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, true);
173 if (result != SDKCheckResults.SDK_PASS) {
174 setErrorMessage(result.getMessage());
175 return;
176 }
177
178 InputDialog profileNameDialog =
179 new InputDialog(null,
180 YoctoSDKMessages.getString(NEW_DIALOG_TITLE),
181 YoctoSDKMessages.getString(NEW_DIALOG_MESSAGE),
182 null,
183 new ProfileNameInputValidator(profileElement));
184
185 int returnCode = profileNameDialog.open();
186 if (returnCode == IDialogConstants.CANCEL_ID) {
187 return;
188 }
189
190 profileElement.addProfile(profileNameDialog.getValue());
191 yoctoProfileSetting.addProfile(profileNameDialog.getValue());
192
193 yoctoUISetting.setCurrentInput(uiElement);
194 performOk();
195 }
196
197 public void switchProfile(String selectedProfile) {
198 setPreferenceStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile));
199 YoctoUIElement profileElement = YoctoSDKUtils.getElemFromStore(getPreferenceStore());
200 yoctoUISetting.setCurrentInput(profileElement);
201 }
202
203 public void renameProfile(String oldProfileName, String newProfileName) {
204 YoctoUIElement oldProfileElement = YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(oldProfileName));
205 saveElemToStore(oldProfileElement, YoctoSDKPlugin.getProfilePreferenceStore(newProfileName));
206
207 renameProfileInAffectedProjects(oldProfileName, newProfileName);
208 }
209
210 public void deleteProfile(String selectedProfile)
211 {
212 resetProfileInAffectedProjects(selectedProfile);
213 }
214
215 /* Save IDE wide POKY Preference settings to a specific preference store */
216 private void saveElemToStore(YoctoUIElement elem, IPreferenceStore store) {
217 store.setValue(PreferenceConstants.TARGET_ARCH_INDEX, elem.getIntTargetIndex());
218
219 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
220 store.setValue(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE);
221 } else {
222 store.setValue(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE);
223 }
224 store.setValue(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc());
225 store.setValue(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption());
226 store.setValue(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc());
227 if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
228 store.setValue(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE);
229 } else {
230 store.setValue(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE);
231 }
232 store.setValue(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot());
233 store.setValue(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget());
234 }
235
236 private void resetProfileInAffectedProjects(String usedProfile)
237 {
238 HashSet<IProject> yoctoProjects = getAffectedProjects(usedProfile);
239 YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
240 profileElement.setSelectedProfile(PreferenceConstants.STANDARD_PROFILE_NAME);
241
242 for (IProject project : yoctoProjects)
243 {
244 ProjectPreferenceUtils.saveProfiles(profileElement, project);
245 YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(
246 YoctoSDKPlugin.getProfilePreferenceStore(PreferenceConstants.STANDARD_PROFILE_NAME));
247 ProjectPreferenceUtils.saveElemToProjectEnv(elem, project);
248 }
249 }
250
251 private void renameProfileInAffectedProjects(String oldProfileName, String newProfileName) {
252 HashSet<IProject> yoctoProjects = getAffectedProjects(oldProfileName);
253 YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
254 profileElement.setSelectedProfile(newProfileName);
255
256 for (IProject project : yoctoProjects)
257 {
258 ProjectPreferenceUtils.saveProfiles(profileElement, project);
259 }
260 }
261
262 private void updateProjects(HashSet<IProject> yoctoProjects, YoctoUIElement elem) {
263 for (IProject project : yoctoProjects)
264 {
265 ProjectPreferenceUtils.saveElemToProjectEnv(elem, project);
266 }
267 }
268
269 private HashSet<IProject> getAffectedProjects(String usedProfile)
270 {
271 HashSet<IProject> yoctoProjects = new HashSet<IProject>();
272
273 IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
274
275 for (IProject project : projects)
276 {
277 try
278 {
279 if (!project.hasNature(YoctoSDKProjectNature.YoctoSDK_NATURE_ID)) {
280 continue;
281 }
282 } catch (CoreException e)
283 {
284 // project is closed or does not exist so don't update
285 continue;
286 }
287
288 if (!projectUsesProfile(project, usedProfile)) {
289 continue;
290 }
291
292 yoctoProjects.add(project);
293 }
294 return yoctoProjects;
295 }
296
297 private boolean projectUsesProfile(IProject project, String profile)
298 {
299 YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfiles(project);
300
301 if (!profileElement.getSelectedProfile().equals(profile)) {
302 return false;
303 }
304
305 return true;
306 }
307}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
new file mode 100644
index 0000000..a85cbd9
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/preferences/YoctoSDKProjectPropertyPage.java
@@ -0,0 +1,202 @@
1/*******************************************************************************
2 * Copyright (c) 2012 BMW Car IT GmbH.
3 * Copyright (c) 2010 Intel.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * BMW Car IT GmbH - initial implementation
11 * Intel - initial API implementation (copied from YoctoSDKPreferencePage)
12 *******************************************************************************/
13package org.yocto.sdk.ide.preferences;
14
15import org.eclipse.core.resources.IProject;
16import org.eclipse.core.runtime.IAdaptable;
17import org.eclipse.jface.dialogs.Dialog;
18import org.eclipse.swt.SWT;
19import org.eclipse.swt.layout.GridLayout;
20import org.eclipse.swt.widgets.Composite;
21import org.eclipse.swt.widgets.Control;
22import org.eclipse.swt.widgets.Event;
23import org.eclipse.swt.widgets.Listener;
24import org.eclipse.ui.IWorkbenchPropertyPage;
25import org.eclipse.ui.dialogs.PropertyPage;
26import org.yocto.sdk.ide.YoctoProfileElement;
27import org.yocto.sdk.ide.YoctoProfileSetting;
28import org.yocto.sdk.ide.YoctoProjectSpecificSetting;
29import org.yocto.sdk.ide.YoctoSDKChecker;
30import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckRequestFrom;
31import org.yocto.sdk.ide.YoctoSDKChecker.SDKCheckResults;
32import org.yocto.sdk.ide.YoctoSDKMessages;
33import org.yocto.sdk.ide.YoctoSDKPlugin;
34import org.yocto.sdk.ide.YoctoUIElement;
35import org.yocto.sdk.ide.YoctoUISetting;
36import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
37import org.yocto.sdk.ide.utils.YoctoSDKUtils;
38
39public class YoctoSDKProjectPropertyPage extends PropertyPage implements
40 IWorkbenchPropertyPage {
41
42 private static final String REVALIDATION_MESSAGE = "Poky.SDK.Revalidation.Message";
43
44 private YoctoProfileSetting yoctoProfileSetting;
45 private YoctoProjectSpecificSetting yoctoProjectSpecificSetting;
46 private YoctoUISetting yoctoUISetting;
47 private IProject project = null;
48
49 private Listener changeListener;
50
51 public YoctoSDKProjectPropertyPage() {
52 changeListener = new Listener() {
53 @Override
54 public void handleEvent(Event event) {
55 if (getErrorMessage() != null) {
56 setErrorMessage(null);
57 setMessage(YoctoSDKMessages.getString(REVALIDATION_MESSAGE), INFORMATION);
58 }
59 }
60 };
61 }
62
63 @Override
64 protected Control createContents(Composite parent) {
65 IProject project = getProject();
66
67 YoctoProfileElement globalProfileElement= YoctoSDKUtils.getProfilesFromDefaultStore();
68 YoctoProfileElement profileElement = ProjectPreferenceUtils.getProfiles(project);
69
70 String selectedProfile = profileElement.getSelectedProfile();
71 if (!globalProfileElement.contains(selectedProfile)) {
72 selectedProfile = globalProfileElement.getSelectedProfile();
73 }
74
75 yoctoProfileSetting = new YoctoProfileSetting(
76 new YoctoProfileElement(globalProfileElement.getProfilesAsString(), selectedProfile), this, false);
77 boolean useProjectSpecificSetting = ProjectPreferenceUtils.getUseProjectSpecificOption(project);
78
79 if (useProjectSpecificSetting) {
80 yoctoUISetting = new YoctoUISetting(ProjectPreferenceUtils.getElem(project));
81 } else {
82 yoctoUISetting = new YoctoUISetting(YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile)));
83 }
84
85 yoctoProjectSpecificSetting = new YoctoProjectSpecificSetting(yoctoProfileSetting, yoctoUISetting, this);
86
87 initializeDialogUnits(parent);
88 final Composite composite = new Composite(parent, SWT.NONE);
89 composite.setLayout(new GridLayout(2, false));
90
91 yoctoProfileSetting.createComposite(composite);
92 yoctoProjectSpecificSetting.createComposite(composite);
93 yoctoUISetting.createComposite(composite);
94
95 if (useProjectSpecificSetting) {
96 yoctoProfileSetting.setUIFormEnabledState(false);
97 yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
98 yoctoUISetting.setUIFormEnabledState(true);
99
100 SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
101 if (result != SDKCheckResults.SDK_PASS) {
102 setErrorMessage(result.getMessage());
103 }
104 } else {
105 yoctoProfileSetting.setUIFormEnabledState(true);
106 yoctoProjectSpecificSetting.setUseProjectSpecificSettings(false);
107 yoctoUISetting.setUIFormEnabledState(false);
108 }
109
110 composite.addListener(SWT.Modify, changeListener);
111 composite.addListener(SWT.Selection, changeListener);
112
113 Dialog.applyDialogFont(composite);
114 return composite;
115 }
116
117 private IProject getProject() {
118 if (project != null) {
119 return project;
120 }
121
122 IAdaptable adaptable = getElement();
123 if (adaptable == null) {
124 throw new IllegalStateException("Project can only be retrieved after properties page has been set up.");
125 }
126
127 project = (IProject) adaptable.getAdapter(IProject.class);
128 return project;
129 }
130
131 /*
132 * @see PreferencePage#performDefaults()
133 */
134 @Override
135 protected void performDefaults() {
136 YoctoUIElement defaultElement = YoctoSDKUtils.getDefaultElemFromDefaultStore();
137 yoctoUISetting.setCurrentInput(defaultElement);
138 yoctoProjectSpecificSetting.setUseProjectSpecificSettings(true);
139 super.performDefaults();
140 }
141
142 /*
143 * @see IPreferencePage#performOk()
144 */
145 @Override
146 public boolean performOk() {
147 clearMessages();
148
149 IProject project = getProject();
150
151 if (yoctoProjectSpecificSetting.isUsingProjectSpecificSettings()) {
152 SDKCheckResults result = yoctoUISetting.validateInput(SDKCheckRequestFrom.Preferences, false);
153 if (result != SDKCheckResults.SDK_PASS) {
154 setErrorMessage(result.getMessage());
155 return false;
156 }
157
158 ProjectPreferenceUtils.saveUseProjectSpecificOption(project, true);
159 ProjectPreferenceUtils.saveProfiles(yoctoProfileSetting.getCurrentInput(), project);
160 ProjectPreferenceUtils.saveElem(yoctoUISetting.getCurrentInput(), project);
161 } else {
162 ProjectPreferenceUtils.saveUseProjectSpecificOption(project, false);
163 ProjectPreferenceUtils.saveProfiles(yoctoProfileSetting.getCurrentInput(), project);
164 }
165
166 ProjectPreferenceUtils.saveElemToProjectEnv(yoctoUISetting.getCurrentInput(), getProject());
167
168 return super.performOk();
169 }
170
171 private void clearMessages() {
172 setErrorMessage(null);
173 setMessage(null);
174 setTitle(getTitle());
175 }
176
177 public void switchProfile(String selectedProfile)
178 {
179 YoctoUIElement profileElement = YoctoSDKUtils.getElemFromStore(YoctoSDKPlugin.getProfilePreferenceStore(selectedProfile));
180 yoctoUISetting.setCurrentInput(profileElement);
181 }
182
183 public void switchToProjectSpecificProfile()
184 {
185 YoctoUIElement profileElement = ProjectPreferenceUtils.getElem(getProject());
186 SDKCheckResults result = YoctoSDKChecker.checkYoctoSDK(profileElement);
187
188 if ((result != SDKCheckResults.SDK_PASS)) {
189 /* Project specific profile has not yet been defined,
190 * leave settings from previously selected profile
191 */
192 return;
193 }
194
195 yoctoUISetting.setCurrentInput(profileElement);
196 }
197
198 public void switchToSelectedProfile()
199 {
200 switchProfile(yoctoProfileSetting.getCurrentInput().getSelectedProfile());
201 }
202}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
new file mode 100644
index 0000000..a06a03c
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/ProjectPreferenceUtils.java
@@ -0,0 +1,240 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * Copyright (c) 2010 Intel Corporation.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Intel - initial implementation
11 * BMW Car IT - initial implementation and refactoring
12 *******************************************************************************/
13package org.yocto.sdk.ide.utils;
14
15import java.io.IOException;
16
17import org.eclipse.cdt.core.CCorePlugin;
18import org.eclipse.cdt.core.ConsoleOutputStream;
19import org.eclipse.cdt.core.resources.IConsole;
20import org.eclipse.core.resources.IProject;
21import org.eclipse.core.resources.ProjectScope;
22import org.eclipse.core.runtime.CoreException;
23import org.eclipse.core.runtime.preferences.IEclipsePreferences;
24import org.eclipse.core.runtime.preferences.IScopeContext;
25import org.eclipse.jface.preference.IPreferenceStore;
26import org.osgi.service.prefs.BackingStoreException;
27import org.yocto.sdk.ide.YoctoGeneralException;
28import org.yocto.sdk.ide.YoctoProfileElement;
29import org.yocto.sdk.ide.YoctoSDKMessages;
30import org.yocto.sdk.ide.YoctoUIElement;
31import org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature;
32import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
33import org.yocto.sdk.ide.preferences.PreferenceConstants;
34
35public class ProjectPreferenceUtils {
36 private static final String CONSOLE_MESSAGE = "Menu.SDK.Console.Configure.Message";
37
38 /* Get POKY Preference settings from project's preference store */
39 public static YoctoUIElement getElem(IProject project) {
40 IScopeContext projectScope = new ProjectScope(project);
41 IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
42 if (projectNode == null) {
43 return getElemFromProjectEnv(project);
44 }
45
46 YoctoUIElement elem = new YoctoUIElement();
47 elem.setStrToolChainRoot(projectNode.get(PreferenceConstants.TOOLCHAIN_ROOT,""));
48 elem.setStrTarget(projectNode.get(PreferenceConstants.TOOLCHAIN_TRIPLET,""));
49 elem.setStrQemuKernelLoc(projectNode.get(PreferenceConstants.QEMU_KERNEL,""));
50 elem.setStrSysrootLoc(projectNode.get(PreferenceConstants.SYSROOT,""));
51 elem.setStrQemuOption(projectNode.get(PreferenceConstants.QEMU_OPTION,""));
52 String sTemp = projectNode.get(PreferenceConstants.TARGET_ARCH_INDEX,"");
53 if (!sTemp.isEmpty()) {
54 elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
55 }
56
57 if (projectNode.get(PreferenceConstants.SDK_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
58 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
59 } else {
60 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
61 }
62
63 if(projectNode.get(PreferenceConstants.TARGET_MODE,"").equalsIgnoreCase(IPreferenceStore.TRUE)) {
64 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
65 } else {
66 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
67 }
68 return elem;
69 }
70
71 /* Get POKY Preference settings from project's environment */
72 public static YoctoUIElement getElemFromProjectEnv(IProject project) {
73 YoctoUIElement elem = new YoctoUIElement();
74 elem.setStrToolChainRoot(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TOOLCHAIN_ROOT));
75 elem.setStrTarget(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TOOLCHAIN_TRIPLET));
76 elem.setStrQemuKernelLoc(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.QEMU_KERNEL));
77 elem.setStrSysrootLoc(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.SYSROOT));
78 elem.setStrQemuOption(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.QEMU_OPTION));
79 String sTemp = YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TARGET_ARCH_INDEX);
80
81 if (!sTemp.isEmpty()) {
82 elem.setIntTargetIndex(Integer.valueOf(sTemp).intValue());
83 }
84
85 if (YoctoSDKUtils.getEnvValue(project, PreferenceConstants.SDK_MODE).equalsIgnoreCase(IPreferenceStore.TRUE)) {
86 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
87 } else {
88 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
89 }
90
91 if(YoctoSDKUtils.getEnvValue(project, PreferenceConstants.TARGET_MODE).equalsIgnoreCase(IPreferenceStore.TRUE)) {
92 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
93 } else {
94 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
95 }
96
97 return elem;
98 }
99
100 /* Get profiles and selected profile from the project's preference store */
101 public static YoctoProfileElement getProfiles(IProject project) {
102 IScopeContext projectScope = new ProjectScope(project);
103 IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
104
105 if (projectNode == null) {
106 return YoctoSDKUtils.getProfilesFromDefaultStore();
107 }
108
109 String profiles = projectNode.get(PreferenceConstants.PROFILES, "");
110 String selectedProfile = projectNode.get(PreferenceConstants.SELECTED_PROFILE, "");
111
112 return new YoctoProfileElement(profiles, selectedProfile);
113 }
114
115 public static boolean getUseProjectSpecificOption(IProject project) {
116 IScopeContext projectScope = new ProjectScope(project);
117 IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
118 if (projectNode == null) {
119 return false;
120 }
121
122 String useProjectSpecificSettingString = projectNode.get(PreferenceConstants.PROJECT_SPECIFIC_PROFILE,
123 IPreferenceStore.FALSE);
124
125 if (useProjectSpecificSettingString.equals(IPreferenceStore.FALSE)) {
126 return false;
127 }
128
129 return true;
130 }
131
132 /* Save POKY Preference settings to project's preference store */
133 public static void saveElem(YoctoUIElement elem, IProject project) {
134 IScopeContext projectScope = new ProjectScope(project);
135 IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
136 if (projectNode == null) {
137 return;
138 }
139
140 projectNode.putInt(PreferenceConstants.TARGET_ARCH_INDEX, elem.getIntTargetIndex());
141 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
142 projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE);
143 } else {
144 projectNode.put(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE);
145 }
146 projectNode.put(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc());
147 projectNode.put(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption());
148 projectNode.put(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc());
149 if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
150 projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE);
151 } else {
152 projectNode.put(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE);
153 }
154 projectNode.put(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot());
155 projectNode.put(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget());
156
157 try {
158 projectNode.flush();
159 } catch (BackingStoreException e) {
160 e.printStackTrace();
161 }
162 }
163
164 /* Save POKY Preference settings to project's environment */
165 public static void saveElemToProjectEnv(YoctoUIElement elem, IProject project) {
166 ConsoleOutputStream consoleOutStream = null;
167
168 try {
169 YoctoSDKUtils.setEnvironmentVariables(project, elem);
170 YoctoSDKUtils.createRemoteDebugAndQemuLaunchers(project, elem);
171
172 if (project.hasNature(YoctoSDKAutotoolsProjectNature.YoctoSDK_AUTOTOOLS_NATURE_ID)) {
173 YoctoSDKAutotoolsProjectNature.configureAutotoolsOptions(project);
174 } else if (project.hasNature(YoctoSDKCMakeProjectNature.YoctoSDK_CMAKE_NATURE_ID)) {
175 YoctoSDKCMakeProjectNature.extendProjectEnvironmentForCMake(project);
176 }
177
178 IConsole console = CCorePlugin.getDefault().getConsole("org.yocto.sdk.ide.YoctoConsole");
179 console.start(project);
180 consoleOutStream = console.getOutputStream();
181 String messages = YoctoSDKMessages.getString(CONSOLE_MESSAGE);
182 consoleOutStream.write(messages.getBytes());
183 } catch (CoreException e) {
184 System.out.println(e.getMessage());
185 } catch (IOException e) {
186 System.out.println(e.getMessage());
187 } catch (YoctoGeneralException e) {
188 System.out.println(e.getMessage());
189 } finally {
190 if (consoleOutStream != null) {
191 try {
192 consoleOutStream.flush();
193 consoleOutStream.close();
194 } catch (IOException e) {
195 // ignore
196 }
197 }
198 }
199 }
200
201 /* Save profiles and selected profile to the project's preference store */
202 public static void saveProfiles(YoctoProfileElement profileElement, IProject project) {
203 IScopeContext projectScope = new ProjectScope(project);
204 IEclipsePreferences projectPreferences = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
205
206 if (projectPreferences == null) {
207 return;
208 }
209
210 projectPreferences.put(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
211 projectPreferences.put(PreferenceConstants.SELECTED_PROFILE, profileElement.getSelectedProfile());
212
213 try {
214 projectPreferences.flush();
215 } catch (BackingStoreException e) {
216 // TODO Auto-generated catch block
217 e.printStackTrace();
218 }
219 }
220
221 public static void saveUseProjectSpecificOption(IProject project, boolean useProjectSpecificSetting) {
222 IScopeContext projectScope = new ProjectScope(project);
223 IEclipsePreferences projectNode = projectScope.getNode(YoctoSDKUtilsConstants.PROJECT_SCOPE);
224 if (projectNode == null) {
225 return;
226 }
227
228 if (useProjectSpecificSetting) {
229 projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.TRUE);
230 } else {
231 projectNode.put(PreferenceConstants.PROJECT_SPECIFIC_PROFILE, IPreferenceStore.FALSE);
232 }
233
234 try {
235 projectNode.flush();
236 } catch (BackingStoreException e) {
237 e.printStackTrace();
238 }
239 }
240}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
new file mode 100644
index 0000000..2ac48f8
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
@@ -0,0 +1,461 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 * BMW Car IT - add methods to use different preference stores
11 * Atanas Gegov (BMW Car IT) - add method to get the project environment
12 *******************************************************************************/
13package org.yocto.sdk.ide.utils;
14
15import java.io.BufferedReader;
16import java.io.File;
17import java.io.FileReader;
18import java.io.FileWriter;
19import java.io.IOException;
20import java.util.ArrayList;
21import java.util.HashMap;
22import java.util.HashSet;
23import java.util.Iterator;
24import java.util.Set;
25import java.util.StringTokenizer;
26
27import org.eclipse.cdt.core.CCorePlugin;
28import org.eclipse.cdt.core.envvar.IContributedEnvironment;
29import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
30import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
31import org.eclipse.cdt.core.model.CoreModel;
32import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
33import org.eclipse.cdt.core.settings.model.ICProjectDescription;
34import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
35import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
36import org.eclipse.core.resources.IProject;
37import org.eclipse.core.runtime.CoreException;
38import org.eclipse.debug.core.DebugPlugin;
39import org.eclipse.debug.core.ILaunchConfiguration;
40import org.eclipse.debug.core.ILaunchConfigurationType;
41import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
42import org.eclipse.debug.core.ILaunchManager;
43import org.eclipse.jface.preference.IPreferenceStore;
44import org.yocto.sdk.ide.YoctoGeneralException;
45import org.yocto.sdk.ide.YoctoProfileElement;
46import org.yocto.sdk.ide.YoctoSDKPlugin;
47import org.yocto.sdk.ide.YoctoUIElement;
48import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
49import org.yocto.sdk.ide.natures.YoctoSDKEmptyProjectNature;
50import org.yocto.sdk.ide.preferences.PreferenceConstants;
51
52public class YoctoSDKUtils {
53
54 private static final String DEFAULT_SYSROOT_PREFIX = "--sysroot=";
55 private static final String LIBTOOL_SYSROOT_PREFIX = "--with-libtool-sysroot=";
56
57 private static final String DEFAULT_USR_BIN = "/usr/bin/";
58 private static final String NATIVE_SYSROOT = "OECORE_NATIVE_SYSROOT";
59
60 public static String getEnvValue(IProject project, String strKey)
61 {
62 ICProjectDescription cpdesc = CoreModel.getDefault().getProjectDescription(project, true);
63 ICConfigurationDescription ccdesc = cpdesc.getActiveConfiguration();
64 IEnvironmentVariableManager manager = CCorePlugin.getDefault().getBuildEnvironmentManager();
65 IContributedEnvironment env = manager.getContributedEnvironment();
66 IEnvironmentVariable var = env.getVariable(strKey, ccdesc);
67
68 if (var == null)
69 {
70 System.out.printf("ENV key %s is NULL\n", strKey);
71 return "";
72 }
73
74 else
75 return var.getValue();
76 }
77
78 /* Save project wide settings into ENV VARs including POKY preference settings
79 * and Environment Script File export VARs
80 */
81 private static void setEnvVars(ICProjectDescription cpdesc,
82 YoctoUIElement elem, HashMap<String, String> envMap) {
83 ICConfigurationDescription ccdesc = cpdesc.getActiveConfiguration();
84 IEnvironmentVariableManager manager = CCorePlugin.getDefault().getBuildEnvironmentManager();
85 IContributedEnvironment env = manager.getContributedEnvironment();
86 String delimiter = manager.getDefaultDelimiter();
87
88 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE)
89 env.addVariable(PreferenceConstants.SDK_MODE, IPreferenceStore.TRUE,
90 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
91 else
92 env.addVariable(PreferenceConstants.SDK_MODE, IPreferenceStore.FALSE,
93 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
94
95 env.addVariable(PreferenceConstants.TOOLCHAIN_ROOT, elem.getStrToolChainRoot(),
96 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
97 env.addVariable(PreferenceConstants.TOOLCHAIN_TRIPLET, elem.getStrTarget(),
98 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
99 env.addVariable(PreferenceConstants.TARGET_ARCH_INDEX, String.valueOf(elem.getIntTargetIndex()),
100 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
101
102 if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE)
103 env.addVariable(PreferenceConstants.TARGET_MODE, IPreferenceStore.TRUE,
104 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
105 else
106 env.addVariable(PreferenceConstants.TARGET_MODE, IPreferenceStore.FALSE,
107 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
108
109 env.addVariable(PreferenceConstants.QEMU_KERNEL, elem.getStrQemuKernelLoc(),
110 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
111 env.addVariable(PreferenceConstants.QEMU_OPTION, elem.getStrQemuOption(),
112 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
113 env.addVariable(PreferenceConstants.SYSROOT, elem.getStrSysrootLoc(),
114 IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
115
116 if (envMap == null)
117 {
118 System.out.println("ENV var hasmap is NULL, Please check ENV script File!");
119 return;
120 }
121 Iterator<String> iter = envMap.keySet().iterator();
122 while (iter.hasNext())
123 {
124 String sKey = (String)iter.next();
125 String sValue = (String)envMap.get(sKey);
126 String targetFilePath;
127 File targetFile;
128 //replace --sysroot
129 if (sKey.matches("CFLAGS") || sKey.matches("CXXFLAGS") || sKey.matches("CXXFLAGS") || sKey.matches("LDFLAGS") ||
130 sKey.matches("CPPFLAGS")) {
131
132 int SYSROOT_idx = sValue.lastIndexOf(DEFAULT_SYSROOT_PREFIX);
133 if (SYSROOT_idx >=0 )
134 sValue = sValue.substring(0, SYSROOT_idx) + DEFAULT_SYSROOT_PREFIX + elem.getStrSysrootLoc();
135 else
136 sValue = " " + DEFAULT_SYSROOT_PREFIX + elem.getStrSysrootLoc();
137 targetFilePath = elem.getStrSysrootLoc() + "/" + elem.getStrTarget();
138 targetFile = new File(targetFilePath);
139 if (targetFile.exists())
140 sValue = sValue + "/" + elem.getStrTarget();
141 } else if (sKey.matches("CONFIGURE_FLAGS")) {
142 int LIBTOOL_idx = sValue.lastIndexOf(LIBTOOL_SYSROOT_PREFIX);
143 if (LIBTOOL_idx >= 0)
144 sValue = sValue.substring(0, LIBTOOL_idx) + LIBTOOL_SYSROOT_PREFIX + elem.getStrSysrootLoc();
145 else
146 sValue = " " + LIBTOOL_SYSROOT_PREFIX + elem.getStrSysrootLoc();
147 targetFilePath = elem.getStrSysrootLoc() + "/" + elem.getStrTarget();
148 targetFile = new File(targetFilePath);
149 if (targetFile.exists())
150 sValue = sValue + "/" + elem.getStrTarget();
151 } else if(sKey.matches("PKG_CONFIG_SYSROOT_DIR") || sKey.matches("OECORE_TARGET_SYSROOT")) {
152 sValue = elem.getStrSysrootLoc();
153 targetFilePath = elem.getStrSysrootLoc() + "/" + elem.getStrTarget();
154 targetFile = new File(targetFilePath);
155 if (targetFile.exists())
156 sValue = sValue + "/" + elem.getStrTarget();
157 } else if (sKey.matches("PKG_CONFIG_PATH")) {
158 sValue = elem.getStrSysrootLoc();
159 targetFilePath = elem.getStrSysrootLoc() + "/" + elem.getStrTarget();
160 targetFile = new File(targetFilePath);
161 if (targetFile.exists())
162 sValue = sValue + "/" + elem.getStrTarget();
163 sValue = sValue + "/usr/lib/pkgconfig";
164 }
165 // env.addVariable(sKey, elem.getStrSysrootLoc(), IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
166 /*
167 else if (sKey.matches("PKG_CONFIG_PATH"))
168 env.addVariable(sKey, elem.getStrSysrootLoc()+"/"+elem.getStrTarget()+"/usr/lib/pkgconfig", IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
169 //env.addVariable(sKey, sValue, IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
170 else if (sKey.matches("PKG_CONFIG_SYSROOT_DIR"))
171 env.addVariable(sKey, elem.getStrSysrootLoc()+"/"+elem.getStrTarget(), IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
172 */
173 env.addVariable(sKey, sValue, IEnvironmentVariable.ENVVAR_REPLACE, delimiter, ccdesc);
174 }
175 //add ACLOCAL OPTS for libtool 2.4 support
176 env.addVariable("OECORE_ACLOCAL_OPTS",
177 "-I " + env.getVariable(NATIVE_SYSROOT, ccdesc).getValue() + "/usr/share/aclocal",
178 IEnvironmentVariable.ENVVAR_REPLACE,
179 delimiter,
180 ccdesc);
181 return;
182
183 }
184
185 private static String getEnvironmentSetupFileFullPath(YoctoUIElement elem) {
186 String envSetupFile = "";
187
188 if (elem.getEnumPokyMode() == YoctoUIElement.PokyMode.POKY_SDK_MODE) {
189 envSetupFile = elem.getStrToolChainRoot() + "/";
190 } else {
191 //POKY TREE Mode
192 envSetupFile = elem.getStrToolChainRoot() + YoctoSDKUtilsConstants.DEFAULT_TMP_PREFIX;
193 }
194 envSetupFile += YoctoSDKUtilsConstants.DEFAULT_ENV_FILE_PREFIX + elem.getStrTarget();
195 return envSetupFile;
196 }
197
198 private static HashMap<String, String> parseEnvScript(String sFileName) {
199 try {
200 HashMap<String, String> envMap = new HashMap<String, String>();
201 File file = new File(sFileName);
202
203 if (file.exists()) {
204 BufferedReader input = new BufferedReader(new FileReader(file));
205
206 try {
207 String line = null;
208
209 while ((line = input.readLine()) != null) {
210 if (!line.startsWith("export")) {
211 continue;
212 }
213 String sKey = line.substring("export".length() + 1, line.indexOf('='));
214 String sValue = line.substring(line.indexOf('=') + 1);
215 if (sValue.startsWith("\"") && sValue.endsWith("\""))
216 sValue = sValue.substring(sValue.indexOf('"') + 1, sValue.lastIndexOf('"'));
217 /* If PATH ending with $PATH, we need to join with current system path */
218 if (sKey.equalsIgnoreCase("PATH")) {
219 if (sValue.lastIndexOf("$PATH") >= 0)
220 sValue = sValue.substring(0, sValue.lastIndexOf("$PATH")) + System.getenv("PATH");
221 }
222 envMap.put(sKey, sValue);
223 System.out.printf("get env key %s value %s\n", sKey, sValue);
224 }
225 } finally {
226 input.close();
227 }
228 }
229
230 return envMap;
231
232 } catch (IOException e) {
233 e.printStackTrace();
234 return null;
235 }
236 }
237
238 public static void setEnvironmentVariables(IProject project, YoctoUIElement elem) {
239 ICProjectDescription cpdesc = CoreModel.getDefault().getProjectDescription(project, true);
240
241 String sFileName = getEnvironmentSetupFileFullPath(elem);
242 HashMap<String, String> envMap = parseEnvScript(sFileName);
243
244 setEnvVars(cpdesc, elem, envMap);
245 try {
246 CoreModel.getDefault().setProjectDescription(project,cpdesc);
247 } catch (CoreException e) {
248 e.printStackTrace();
249 }
250 }
251
252 public static void createRemoteDebugAndQemuLaunchers(IProject project, YoctoUIElement elem) throws YoctoGeneralException {
253 ILaunchManager lManager = DebugPlugin.getDefault().getLaunchManager();
254 ILaunchConfigurationType configType =
255 lManager.getLaunchConfigurationType("org.eclipse.ui.externaltools.ProgramLaunchConfigurationType");
256 ILaunchConfigurationType debug_configType =
257 lManager.getLaunchConfigurationType("org.eclipse.cdt.launch.remoteApplicationLaunchType");
258
259 String sPath = getEnvValue(project, "PATH");
260 String sDebugName = getEnvValue(project, "GDB");
261 String sysroot_str = elem.getStrSysrootLoc();
262
263 if (configType == null || debug_configType == null) {
264 throw new YoctoGeneralException("Failed to get program or remote debug launcher!");
265 }
266 createRemoteDebugLauncher(project, lManager, debug_configType, elem.getStrTarget(), sPath, sDebugName, sysroot_str);
267
268 ArrayList<String> listValue = new ArrayList<String>();
269 listValue.add(new String("org.eclipse.ui.externaltools.launchGroup"));
270
271 if (elem.getEnumDeviceMode() == YoctoUIElement.DeviceMode.QEMU_MODE) {
272 String sFileName = getEnvironmentSetupFileFullPath(elem);
273 createQemuLauncher(project, configType, listValue, sFileName, elem);
274 }
275 }
276
277 protected static void createRemoteDebugLauncher(IProject project,
278 ILaunchManager lManager, ILaunchConfigurationType configType,
279 String sTargetTriplet, String strPath, String sDebugName, String sSysroot) {
280 try {
281
282 String sDebugSubDir = DEFAULT_USR_BIN + sTargetTriplet;
283 StringTokenizer token = new StringTokenizer(strPath, ":");
284 String strDebugger = "";
285 while (token.hasMoreTokens())
286 {
287 String sTemp = token.nextToken();
288 if (sTemp.endsWith(sDebugSubDir)) {
289 strDebugger = sTemp + "/" + sDebugName;
290 break;
291 }
292 }
293 if (strDebugger.isEmpty())
294 return;
295 //If get default Debugger successfully, go ahead!
296
297 //create the gdbinit file
298 String sDebugInitFile = project.getLocation().toString() + "/.gdbinit";
299 FileWriter out = new FileWriter(new File(sDebugInitFile));
300 out.write("set sysroot " + sSysroot);
301 out.flush();
302 out.close();
303
304 //set the launch configuration
305 String projectName = project.getName();
306 String configName = projectName+"_gdb_"+sTargetTriplet;
307 int i;
308 ILaunchConfiguration[] configs=lManager.getLaunchConfigurations(configType);
309 for(i=0; i<configs.length; i++)
310 { //delete the old configuration
311 ILaunchConfiguration config=configs[i];
312 if(config.getName().equals(configName)) {
313 config.delete();
314 break;
315 }
316 }
317 ILaunchConfigurationWorkingCopy w_copy = configType.newInstance(project, configName);
318 Set<String> modes=new HashSet<String>();
319 modes.add("debug");
320 w_copy.setPreferredLaunchDelegate(modes, "org.eclipse.rse.remotecdt.launch");
321 w_copy.setAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, sDebugInitFile);
322 w_copy.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, false);
323 w_copy.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, strDebugger);
324 w_copy.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_PROTOCOL, "mi");
325 //TWEAK avoid loading default values in org.eclipse.cdt.launch.remote.tabs.RemoteCDebuggerTab
326 w_copy.setAttribute("org.eclipse.cdt.launch.remote.RemoteCDSFDebuggerTab.DEFAULTS_SET",true);
327 w_copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
328 if (!project.hasNature(YoctoSDKEmptyProjectNature.YoctoSDK_EMPTY_NATURE_ID)) {
329 String pathToCompiledBinary = "";
330 if (project.hasNature(YoctoSDKCMakeProjectNature.YoctoSDK_CMAKE_NATURE_ID)) {
331 pathToCompiledBinary = "Debug/";
332 } else {
333 pathToCompiledBinary = "src/";
334 }
335 pathToCompiledBinary += projectName;
336 w_copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, pathToCompiledBinary);
337 }
338
339 w_copy.doSave();
340 }
341 catch (CoreException e)
342 {
343 System.out.println(e.getMessage());
344 }
345 catch (IOException e)
346 {
347 System.out.println("Failed to generate debug init file!");
348 System.out.println(e.getMessage());
349 }
350 }
351
352 protected static void createQemuLauncher(IProject project,
353 ILaunchConfigurationType configType,
354 ArrayList<String> listValue, String sScriptFile,
355 YoctoUIElement elem) {
356 try {
357
358 ILaunchConfigurationWorkingCopy w_copy = configType.newInstance(null, "qemu_"+elem.getStrTarget());
359
360 w_copy.setAttribute("org.eclipse.debug.ui.favoriteGroups", listValue);
361 w_copy.setAttribute("org.eclipse.ui.externaltools.ATTR_LOCATION", "/usr/bin/xterm");
362
363 String argument = "-e \"source " + sScriptFile + ";runqemu " + qemuTargetTranslate(elem.getStrTarget()) + " " +
364 elem.getStrQemuKernelLoc() + " " + elem.getStrSysrootLoc() + " " + elem.getStrQemuOption() + ";bash\"";
365
366 w_copy.setAttribute("org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS", argument);
367 w_copy.doSave();
368 } catch (CoreException e) {
369 }
370
371 }
372
373 private static String qemuTargetTranslate(String strTargetArch) {
374 String qemu_target = "";
375 if (strTargetArch.indexOf("i586") != -1) {
376 qemu_target = "qemux86";
377 } else if (strTargetArch.indexOf("x86_64") != -1) {
378 qemu_target = "qemux86-64";
379 } else if (strTargetArch.indexOf("arm") != -1) {
380 qemu_target = "qemuarm";
381 } else if (strTargetArch.indexOf("mips") != -1) {
382 qemu_target = "qemumips";
383 } else if (strTargetArch.indexOf("ppc") != -1) {
384 qemu_target = "qemuppc";
385 }
386 return qemu_target;
387 }
388
389 /* Get IDE wide POKY Preference settings from a specific preference store */
390 public static YoctoUIElement getElemFromStore(IPreferenceStore store) {
391 YoctoUIElement elem = new YoctoUIElement();
392 if (store.getString(PreferenceConstants.SDK_MODE).equals(IPreferenceStore.TRUE))
393 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
394 else
395 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
396
397 elem.setStrToolChainRoot(store.getString(PreferenceConstants.TOOLCHAIN_ROOT));
398 elem.setStrTarget(store.getString(PreferenceConstants.TOOLCHAIN_TRIPLET));
399 elem.setIntTargetIndex(store.getInt(PreferenceConstants.TARGET_ARCH_INDEX));
400 elem.setStrQemuKernelLoc(store.getString(PreferenceConstants.QEMU_KERNEL));
401 elem.setStrQemuOption(store.getString(PreferenceConstants.QEMU_OPTION));
402 elem.setStrSysrootLoc(store.getString(PreferenceConstants.SYSROOT));
403
404 if (store.getString(PreferenceConstants.TARGET_MODE).equals(IPreferenceStore.TRUE))
405 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
406 else
407 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
408
409 return elem;
410 }
411
412 /* Get default POKY Preference settings from the default preference store */
413 public static YoctoUIElement getDefaultElemFromDefaultStore()
414 {
415 IPreferenceStore store = YoctoSDKPlugin.getDefault().getPreferenceStore();
416 YoctoUIElement elem = new YoctoUIElement();
417 if (store.getDefaultString(PreferenceConstants.SDK_MODE).equals(IPreferenceStore.TRUE))
418 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_SDK_MODE);
419 else
420 elem.setEnumPokyMode(YoctoUIElement.PokyMode.POKY_TREE_MODE);
421
422 elem.setStrToolChainRoot(store.getDefaultString(PreferenceConstants.TOOLCHAIN_ROOT));
423 elem.setStrTarget(store.getDefaultString(PreferenceConstants.TOOLCHAIN_TRIPLET));
424 elem.setIntTargetIndex(store.getDefaultInt(PreferenceConstants.TARGET_ARCH_INDEX));
425 elem.setStrQemuKernelLoc(store.getDefaultString(PreferenceConstants.QEMU_KERNEL));
426 elem.setStrQemuOption(store.getDefaultString(PreferenceConstants.QEMU_OPTION));
427 elem.setStrSysrootLoc(store.getDefaultString(PreferenceConstants.SYSROOT));
428
429 if (store.getDefaultString(PreferenceConstants.TARGET_MODE).equals(IPreferenceStore.TRUE))
430 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.QEMU_MODE);
431 else
432 elem.setEnumDeviceMode(YoctoUIElement.DeviceMode.DEVICE_MODE);
433
434 return elem;
435 }
436
437 /* Save profiles and selected profile to the default preference store */
438 public static void saveProfilesToDefaultStore(YoctoProfileElement profileElement) {
439 saveProfilesToStore(profileElement, YoctoSDKPlugin.getDefault().getPreferenceStore());
440 }
441
442 /* Save profiles and selected profile to a specific preference store */
443 private static void saveProfilesToStore(YoctoProfileElement profileElement, IPreferenceStore store) {
444 store.setValue(PreferenceConstants.PROFILES, profileElement.getProfilesAsString());
445 store.setValue(PreferenceConstants.SELECTED_PROFILE, profileElement.getSelectedProfile());
446 }
447
448 /* Get profiles and selected profile from the default preference store */
449 public static YoctoProfileElement getProfilesFromDefaultStore()
450 {
451 return getProfilesFromStore(YoctoSDKPlugin.getDefault().getPreferenceStore());
452 }
453
454 /* Get profiles and selected profile from a specific preference store */
455 private static YoctoProfileElement getProfilesFromStore(IPreferenceStore store) {
456 String profiles = store.getString(PreferenceConstants.PROFILES);
457 String selectedProfile = store.getString(PreferenceConstants.SELECTED_PROFILE);
458
459 return new YoctoProfileElement(profiles, selectedProfile);
460 }
461}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtilsConstants.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtilsConstants.java
new file mode 100644
index 0000000..65dfce8
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtilsConstants.java
@@ -0,0 +1,18 @@
1/*******************************************************************************
2 * Copyright (c) 2013 BMW Car IT GmbH.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * BMW Car IT - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.utils;
12
13public class YoctoSDKUtilsConstants {
14
15 public static final String DEFAULT_ENV_FILE_PREFIX = "environment-setup-";
16 public static final String DEFAULT_TMP_PREFIX = "/tmp/";
17 public static final String PROJECT_SCOPE = "org.yocto.sdk.ide";
18}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoAutotoolsProjectPostProcess.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoAutotoolsProjectPostProcess.java
new file mode 100644
index 0000000..f467dac
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoAutotoolsProjectPostProcess.java
@@ -0,0 +1,81 @@
1/*******************************************************************************
2 * Copyright (c) 2012 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.wizard;
12
13import java.io.BufferedReader;
14import java.io.File;
15import java.io.InputStream;
16import java.io.InputStreamReader;
17
18import org.eclipse.cdt.core.templateengine.TemplateCore;
19import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
20import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
21import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
22import org.eclipse.cdt.core.templateengine.process.processes.Messages;
23import org.eclipse.core.resources.IProject;
24import org.eclipse.core.resources.ResourcesPlugin;
25import org.eclipse.core.runtime.IPath;
26import org.eclipse.core.runtime.IProgressMonitor;
27import org.yocto.sdk.ide.YoctoSDKMessages;
28import org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature;
29
30public class NewYoctoAutotoolsProjectPostProcess extends ProcessRunner {
31
32 public static final String CHMOD_COMMAND = "chmod +x "; //$NON-NLS-1$
33 public static final String AUTOGEN_SCRIPT_NAME = "autogen.sh"; //$NON-NLS-1$
34
35 public NewYoctoAutotoolsProjectPostProcess() {}
36
37 public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
38
39 String projectName = args[0].getSimpleValue();
40
41 IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
42 try {
43 if (!project.exists()) {
44 throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
45 } else if (!project.hasNature(YoctoSDKAutotoolsProjectNature.YoctoSDK_AUTOTOOLS_NATURE_ID)) {
46 throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + //$NON-NLS-1$
47 YoctoSDKMessages.getFormattedString("AutotoolsProjectPostProcess.WrongProjectNature", //$NON-NLS-1$
48 projectName));
49 } else {
50 IPath path = project.getLocation();
51 String path_str = path.toString();
52 String autogen_cmd = CHMOD_COMMAND + path_str + File.separator + AUTOGEN_SCRIPT_NAME;
53 try {
54 Runtime rt = Runtime.getRuntime();
55 Process proc = rt.exec(autogen_cmd);
56 InputStream stdin = proc.getInputStream();
57 InputStreamReader isr = new InputStreamReader(stdin);
58 BufferedReader br = new BufferedReader(isr);
59 String line = null;
60 String error_message = ""; //$NON-NLS-1$
61
62 while ( (line = br.readLine()) != null) {
63 error_message = error_message + line;
64 }
65
66 int exitVal = proc.waitFor();
67 if (exitVal != 0) {
68 throw new ProcessFailureException(
69 YoctoSDKMessages.getFormattedString("AutotoolsProjectPostProcess.ChmodFailure", //$NON-NLS-1$
70 projectName));
71 }
72 } catch (Throwable t) {
73 t.printStackTrace();
74
75 }
76 }
77 } catch (Exception e) {
78 throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
79 }
80 }
81}
diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
new file mode 100644
index 0000000..d8c1232
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/wizard/NewYoctoProjectTemplateProcess.java
@@ -0,0 +1,270 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.ide.wizard;
12
13import java.util.Arrays;
14import java.util.LinkedHashMap;
15import java.util.List;
16import java.util.regex.Matcher;
17import java.util.regex.Pattern;
18
19import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
20import org.eclipse.cdt.core.CCorePlugin;
21import org.eclipse.cdt.core.templateengine.TemplateCore;
22import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
23import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
24import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
25import org.eclipse.cdt.core.templateengine.process.processes.Messages;
26import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
27import org.eclipse.cdt.make.core.MakeCorePlugin;
28import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager;
29import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
30import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IPerProjectDiscoveredPathInfo;
31import org.eclipse.cdt.make.internal.core.scannerconfig.util.SymbolEntry;
32import org.eclipse.cdt.managedbuilder.core.BuildException;
33import org.eclipse.cdt.managedbuilder.core.IConfiguration;
34import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
35import org.eclipse.cdt.managedbuilder.core.IOption;
36import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
37import org.eclipse.cdt.managedbuilder.templateengine.ProjectCreatedActions;
38import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
39import org.eclipse.jface.wizard.IWizardPage;
40import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
41import org.eclipse.cdt.internal.ui.wizards.ICDTCommonProjectWizard;
42import org.eclipse.core.resources.IProject;
43import org.eclipse.core.resources.IWorkspace;
44import org.eclipse.core.resources.IWorkspaceDescription;
45import org.eclipse.core.resources.ResourcesPlugin;
46import org.eclipse.core.runtime.CoreException;
47import org.eclipse.core.runtime.IPath;
48import org.eclipse.core.runtime.IProgressMonitor;
49import org.eclipse.core.runtime.OperationCanceledException;
50import org.eclipse.core.runtime.Path;
51import org.eclipse.jface.preference.IPreferenceStore;
52import org.yocto.sdk.ide.YoctoGeneralException;
53import org.yocto.sdk.ide.YoctoProfileElement;
54import org.yocto.sdk.ide.YoctoSDKChecker;
55import org.yocto.sdk.ide.YoctoSDKMessages;
56import org.yocto.sdk.ide.YoctoSDKPlugin;
57import org.yocto.sdk.ide.YoctoUIElement;
58import org.yocto.sdk.ide.natures.YoctoSDKAutotoolsProjectNature;
59import org.yocto.sdk.ide.natures.YoctoSDKCMakeProjectNature;
60import org.yocto.sdk.ide.natures.YoctoSDKEmptyProjectNature;
61import org.yocto.sdk.ide.natures.YoctoSDKNatureUtils;
62import org.yocto.sdk.ide.natures.YoctoSDKProjectNature;
63import org.yocto.sdk.ide.utils.ProjectPreferenceUtils;
64import org.yocto.sdk.ide.utils.YoctoSDKUtils;
65
66@SuppressWarnings("restriction")
67public class NewYoctoProjectTemplateProcess extends ProcessRunner {
68 protected boolean savedAutoBuildingValue;
69 protected ProjectCreatedActions pca;
70 protected IManagedBuildInfo info;
71 protected List<Character> illegalChars = Arrays.asList('$', '"','#','%','&','\'','(',')','*', '+', ',','.','/',':',';','<','=','>','?','@','[','\\',']','^','`','{','|','}','~');
72 private static final String PROJECT_NAME_ERROR = "Wizard.SDK.Error.ProjectName";
73
74 private boolean isCProject;
75 private boolean isEmptyProject;
76 private boolean isAutotoolsProject;
77 private boolean isCMakeProject;
78
79 public NewYoctoProjectTemplateProcess() {
80 pca = new ProjectCreatedActions();
81
82 isCProject = false;
83 isEmptyProject = false;
84 isAutotoolsProject = false;
85 isCMakeProject = false;
86 }
87
88 private String printIllegalChars(){
89 String print = "";
90 for (Character ch : illegalChars)
91 print += ch + ", ";
92 print = print.substring(0, print.length() - 2);
93 return print;
94 }
95
96 public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
97
98 String projectName = args[0].getSimpleValue();
99 String location = args[1].getSimpleValue();
100 String artifactExtension = args[2].getSimpleValue();
101 String isCProjectValue = args[3].getSimpleValue();
102 String isEmptyProjetValue = args[4].getSimpleValue();
103 String isAutotoolsProjectValue = args[5].getSimpleValue();
104 String isCMakeProjectValue = args[6].getSimpleValue();
105
106 isCProject = Boolean.valueOf(isCProjectValue).booleanValue();
107 isEmptyProject = Boolean.valueOf(isEmptyProjetValue).booleanValue();
108 isAutotoolsProject = Boolean.valueOf(isAutotoolsProjectValue).booleanValue();
109 isCMakeProject = Boolean.valueOf(isCMakeProjectValue).booleanValue();
110
111 IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
112 try {
113 if (!isValidProjectName(projectName)) {
114
115 IWizardPage[] pages = MBSCustomPageManager.getPages();
116 if(pages != null && pages.length > 0) {
117 CDTMainWizardPage cdtMainPage = (CDTMainWizardPage)pages[0];
118 cdtMainPage.setPageComplete(false);
119 ICDTCommonProjectWizard wizard = (ICDTCommonProjectWizard) pages[0].getWizard();
120 wizard.performCancel();
121
122 project.delete(true, null);
123 }
124 throw new ProcessFailureException(YoctoSDKMessages.getFormattedString(PROJECT_NAME_ERROR, new Object[]{projectName, printIllegalChars()}));
125 }
126
127 if (!project.exists()) {
128 IWorkspace workspace = ResourcesPlugin.getWorkspace();
129 turnOffAutoBuild(workspace);
130
131 IPath locationPath = null;
132 if (location != null && !location.trim().equals("")) { //$NON-NLS-1$
133 locationPath = Path.fromPortableString(location);
134 }
135
136 List<?> configs = template.getTemplateInfo().getConfigurations();
137
138 if (configs == null || configs.size() == 0) {
139 throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
140 }
141
142 pca.setProject(project);
143 pca.setProjectLocation(locationPath);
144 pca.setConfigs((IConfiguration[]) configs.toArray(new IConfiguration[configs.size()]));
145 pca.setArtifactExtension(artifactExtension);
146 info = pca.createProject(monitor, CCorePlugin.DEFAULT_INDEXER, isCProject);
147
148 addNatures(project, false, monitor);
149
150 info.setValid(true);
151 ManagedBuildManager.saveBuildInfo(project, true);
152
153 restoreAutoBuild(workspace);
154 } else {
155
156 IWorkspace workspace = ResourcesPlugin.getWorkspace();
157 turnOffAutoBuild(workspace);
158
159 YoctoSDKChecker.checkIfGloballySelectedYoctoProfileIsValid();
160
161 addNatures(project, true, monitor);
162
163 //restoreAutoBuild(workspace);
164 IDiscoveredPathManager manager = MakeCorePlugin.getDefault().getDiscoveryManager();
165 IDiscoveredPathInfo pathInfo = manager.getDiscoveredInfo(project);
166
167 if (pathInfo instanceof IPerProjectDiscoveredPathInfo) {
168 IPerProjectDiscoveredPathInfo projectPathInfo =
169 (IPerProjectDiscoveredPathInfo) pathInfo;
170 projectPathInfo.setIncludeMap(new LinkedHashMap<String, Boolean>());
171 projectPathInfo.setSymbolMap(new LinkedHashMap<String, SymbolEntry>());
172 manager.removeDiscoveredInfo(project);
173 }
174 }
175 }
176 catch (CoreException e)
177 {
178 throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
179 }
180 catch (BuildException e)
181 {
182 throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage()); //$NON-NLS-1$
183 }
184 catch (YoctoGeneralException e)
185 {
186 try {
187 project.delete(true, monitor);
188 } catch (CoreException err) {
189 throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage() //$NON-NLS-1$
190 + " " + err.getMessage()); //$NON-NLS-1$
191 }
192 throw new OperationCanceledException(Messages.getString("NewManagedProject.3") + e.getMessage()); //$NON-NLS-1$
193 }
194 }
195
196 private boolean isValidProjectName(String projectName) {
197 Pattern pattern = Pattern.compile("^[a-zA-Z][a-zA-Z0-9_\\-]*$"); //$NON-NLS-1$
198 Matcher matcher = pattern.matcher(projectName);
199 return matcher.find();
200 }
201
202 private void addNatures(IProject project, boolean projectExists, IProgressMonitor monitor)
203 throws CoreException, YoctoGeneralException {
204 YoctoSDKNatureUtils.addNature(project, YoctoSDKProjectNature.YoctoSDK_NATURE_ID, monitor);
205
206 YoctoSDKChecker.checkIfGloballySelectedYoctoProfileIsValid();
207
208 YoctoProfileElement profileElement = YoctoSDKUtils.getProfilesFromDefaultStore();
209 ProjectPreferenceUtils.saveProfiles(profileElement, project);
210
211 IPreferenceStore selecteProfileStore = YoctoSDKPlugin.getProfilePreferenceStore(profileElement.getSelectedProfile());
212 YoctoUIElement elem = YoctoSDKUtils.getElemFromStore(selecteProfileStore);
213 YoctoSDKUtils.setEnvironmentVariables(project, elem);
214
215 if (isEmptyProject) {
216 YoctoSDKNatureUtils.addNature(project, YoctoSDKEmptyProjectNature.YoctoSDK_EMPTY_NATURE_ID, monitor);
217 }
218
219 if (isAutotoolsProject) {
220 AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
221
222 if (!projectExists) {
223 // For each IConfiguration, create a corresponding Autotools Configuration
224 for (IConfiguration cfg : pca.getConfigs()) {
225 AutotoolsConfigurationManager.getInstance().getConfiguration(project, cfg.getName(), true);
226 }
227 AutotoolsConfigurationManager.getInstance().saveConfigs(project);
228 }
229
230 YoctoSDKNatureUtils.addNature(project, YoctoSDKAutotoolsProjectNature.YoctoSDK_AUTOTOOLS_NATURE_ID, monitor);
231 YoctoSDKAutotoolsProjectNature.configureAutotoolsOptions(project);
232 } else if (isCMakeProject) {
233 YoctoSDKNatureUtils.addNature(project, YoctoSDKCMakeProjectNature.YoctoSDK_CMAKE_NATURE_ID, monitor);
234 YoctoSDKCMakeProjectNature.extendProjectEnvironmentForCMake(project);
235 }
236
237 YoctoSDKUtils.createRemoteDebugAndQemuLaunchers(project, elem);
238 }
239
240 protected final void turnOffAutoBuild(IWorkspace workspace) throws CoreException {
241 IWorkspaceDescription workspaceDesc = workspace.getDescription();
242 savedAutoBuildingValue = workspaceDesc.isAutoBuilding();
243 workspaceDesc.setAutoBuilding(false);
244 workspace.setDescription(workspaceDesc);
245 }
246
247 protected final void restoreAutoBuild(IWorkspace workspace) throws CoreException {
248 IWorkspaceDescription workspaceDesc = workspace.getDescription();
249 workspaceDesc.setAutoBuilding(savedAutoBuildingValue);
250 workspace.setDescription(workspaceDesc);
251 }
252
253 /**
254 * setOptionValue
255 * @param config
256 * @param option
257 * @param val
258 * @throws BuildException
259 */
260 protected void setOptionValue(IConfiguration config, IOption option, String val) throws BuildException {
261 if (val != null) {
262 if (!option.isExtensionElement()) {
263 option.setValue(val);
264 } else {
265 IOption newOption = config.getToolChain().createOption(option, option.getId() + "." + ManagedBuildManager.getRandomNumber(), option.getName(), false); //$NON-NLS-1$
266 newOption.setValue(val);
267 }
268 }
269 }
270}
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.properties b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.properties
new file mode 100644
index 0000000..c7e7867
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.properties
@@ -0,0 +1,14 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - Initial implementation
10 *******************************************************************************/
11
12#Template Default Values
13EmptyProject.template.label=Empty C Autotools Project
14EmptyProject.template.description=An empty C Yocto Project autotools project template
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.xml b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.xml
new file mode 100644
index 0000000..e1c1abc
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCAutotoolsProject/template.xml
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
3 copyright="Copyright (c) 2007 Intel Corporation and others. 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"
4
5 id="YoctoEmptyCAutotoolsProject" label="%EmptyProject.template.label" description="%EmptyProject.template.description"
6 help="help.html">
7
8 <process type="org.yocto.sdk.ide.NewYoctoProject">
9 <simple name="name" value="$(projectName)" />
10 <simple name="artifactExtension" value="exe" />
11 <simple name="isCProject" value="true" />
12 <simple name="isEmptyProject" value="true" />
13 <simple name="isAutotoolsProject" value="true" />
14 <simple name="isCMakeProject" value="false" />
15 </process>
16
17</template>
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.properties b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.properties
new file mode 100644
index 0000000..416e2ef
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.properties
@@ -0,0 +1,14 @@
1/*******************************************************************************
2 * Copyright (c) 2010 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - Initial implementation
10 *******************************************************************************/
11
12#Template Default Values
13EmptyProject.template.label=Empty C++ Autotools Project
14EmptyProject.template.description=An empty CPP Yocto Project autotools project template
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.xml b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.xml
new file mode 100644
index 0000000..9f1d46b
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/EmptyCPPAutotoolsProject/template.xml
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
3 copyright="Copyright (c) 2007 Intel Corporation and others. 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"
4 id="YoctoEmptyCppAutotoolsProject" label="%EmptyProject.template.label" description="%EmptyProject.template.description"
5 help="help.html">
6
7 <process type="org.yocto.sdk.ide.NewYoctoProject">
8 <simple name="name" value="$(projectName)" />
9 <simple name="artifactExtension" value="exe" />
10 <simple name="isCProject" value="false" />
11 <simple name="isEmptyProject" value="true" />
12 <simple name="isAutotoolsProject" value="true" />
13 <simple name="isCMakeProject" value="false" />
14 </process>
15
16</template>
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c
new file mode 100644
index 0000000..862467a
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c
@@ -0,0 +1,9 @@
1
2
3#include <stdlib.h>
4#include <stdio.h>
5
6int main(void) {
7 puts("Hello World"); /* prints Hello World */
8 return 0;
9}
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.desktop.in.src b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.desktop.in.src
new file mode 100644
index 0000000..e96420f
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.desktop.in.src
@@ -0,0 +1,9 @@
1[Desktop Entry]
2Version=@VERSION@
3Encoding=UTF-8
4Name=$(projectName)
5Comment=A "$(message)"
6Type=Application
7Categories=Application
8Exec=$(projectName)
9Name[en_US]=$(message)
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/INSTALL b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/INSTALL
new file mode 100644
index 0000000..b8b0535
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/INSTALL
@@ -0,0 +1,9 @@
1Building:
2 $ ./autogen.sh [--enable-gtk-doc] [--prefix=/usr]
3 $ make
4
5Installing:
6 $ sudo make install
7
8Running:
9 $ $(projectName) \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src
new file mode 100644
index 0000000..fc3bc8c
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src
@@ -0,0 +1,8 @@
1
2bin_PROGRAMS = $(projectName)
3$(projectName)_SOURCES = $(projectName).c
4
5AM_CFLAGS = @$(projectName)_CFLAGS@
6AM_LDFLAGS = @$(projectName)_LIBS@
7
8CLEANFILES = *~
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top
new file mode 100644
index 0000000..7bee2b7
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top
@@ -0,0 +1,7 @@
1SUBDIRS = $(sourceDir)
2
3MAINTAINERCLEANFILES = aclocal.m4 compile config.guess \
4 config.sub configure depcomp install-sh \
5 ltmain.sh Makefile.in missing
6
7
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README
new file mode 100644
index 0000000..ec15541
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README
@@ -0,0 +1,25 @@
1$(projectName)
2Copyright (C) $(copyright).
3
4Brief description of project....
5
6-----------------------------------------------------------------------------
7 Build
8-----------------------------------------------------------------------------
9$ ./autogen.sh $CONFIGURE_FLAGS
10$ make
11
12-----------------------------------------------------------------------------
13 Build with documentation generated (usually for libraries)
14-----------------------------------------------------------------------------
15$ ./autogen.sh --enable-gtk-doc
16$ make
17
18( If built with the --enable-gtk-doc flag above you can view the index.html
19 file in your web browser. )
20$ firefox ./docs/reference/index.html
21
22-----------------------------------------------------------------------------
23 Install
24-----------------------------------------------------------------------------
25$ sudo make install
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/autogen.sh b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/autogen.sh
new file mode 100755
index 0000000..7fd81e2
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/autogen.sh
@@ -0,0 +1,10 @@
1#! /bin/sh
2[ -e config.cache ] && rm -f config.cache
3
4libtoolize --automake
5aclocal ${OECORE_ACLOCAL_OPTS}
6autoconf
7autoheader
8automake -a
9./configure $@
10exit
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top
new file mode 100644
index 0000000..234ab99
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top
@@ -0,0 +1,37 @@
1AC_PREREQ(2.61)
2
3# package version number (not shared library version)
4# odd micro numbers indicate in-progress development
5# even micro numbers indicate released versions
6m4_define($(projectName)_version_major, 0)
7m4_define($(projectName)_version_minor, 1)
8m4_define($(projectName)_version_micro, 0)
9
10m4_define([$(projectName)_version],
11 [$(projectName)_version_major.$(projectName)_version_minor.$(projectName)_version_micro])
12m4_define([$(projectName)_api_version],
13 [$(projectName)_version_major.$(projectName)_version_minor])
14
15AC_INIT($(projectName), $(projectName)_version)
16AM_INIT_AUTOMAKE($(projectName), $(projectName)_version)
17AC_CONFIG_HEADERS(config.h)
18
19# Checks for programs.
20AC_PROG_LIBTOOL
21AM_PROG_CC_C_O
22AC_PROG_INSTALL
23
24AC_SUBST($(projectName)_CFLAGS)
25AC_SUBST($(projectName)_LIBS)
26
27AC_OUTPUT([
28Makefile
29$(sourceDir)/Makefile
30])
31
32echo ""
33echo " $(projectName) $VERSION"
34echo " ====================="
35echo ""
36echo " To build the project, run \"make\""
37echo ""
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties
new file mode 100644
index 0000000..12830ea
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties
@@ -0,0 +1,28 @@
1###############################################################################
2# Copyright (c) 2007, 2009 Symbian Software Private Ltd. and others.
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
7#
8# Contributors:
9# Bala Torati (Symbian) - initial API and implementation
10# Red Hat Inc - modification to use with Autotools project
11###############################################################################
12
13#Template Default Values
14HelloWorld.CAnsitemplate.label=Hello World ANSI C Autotools Project
15HelloWorld.CAnsitemplate.description=A skeletal C Hello World project. Creates a folder for sources and autogen artifacts.
16HelloWorld.basics.label=Basic Settings
17HelloWorld.basics.description=Basic properties of a project
18HelloWorld.author.label=Author
19HelloWorld.author.description=Name of the author
20HelloWorld.copyright.label=Copyright notice
21HelloWorld.copyright.description=The name of the copyright holder (e.g. XYZ Corporation)
22HelloWorld.copyright.default=Your copyright
23HelloWorld.message.default=Hello World
24HelloWorld.message.description=Your hello world greeting message
25HelloWorld.message.label=Hello world greeting
26HelloWorld.sourceDir.label=Source
27HelloWorld.sourceDir.description=Directory for hello world project source files
28HelloWorld.sourceDir.default=src
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml
new file mode 100644
index 0000000..ca154ca
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml
@@ -0,0 +1,143 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
3 copyright="Copyright (c) 2007,2009 Symbian Software Limited and others. 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 athttp://www.eclipse.org/legal/epl-v10.html"
4 id="YoctoHelloWorldCAutotoolsProject" label="%HelloWorld.CAnsitemplate.label" description="%HelloWorld.CAnsitemplate.description"
5 help="help.html">
6
7 <property-group id="basics" label="%HelloWorld.basics.label" description="%HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
8 <property id="author"
9 label="%HelloWorld.author.label"
10 description="%HelloWorld.author.description"
11 type="input"
12 pattern=".+"
13 default=""
14 hidden="false"
15 mandatory="true"
16 persist="true"/>
17 <property id="copyright"
18 label="%HelloWorld.copyright.label"
19 description="%HelloWorld.copyright.description"
20 type="input"
21 pattern=".+"
22 default="%HelloWorld.copyright.default"
23 hidden="false"
24 mandatory="true"
25 persist="true"/>
26 <property id="message"
27 label="%HelloWorld.message.label"
28 description="%HelloWorld.message.description"
29 type="input"
30 pattern=".+"
31 default="%HelloWorld.message.default"
32 hidden="false"
33 mandatory="true"
34 persist="true"/>
35 <property id="sourceDir"
36 label="%HelloWorld.sourceDir.label"
37 description="%HelloWorld.sourceDir.description"
38 type="input"
39 default="%HelloWorld.sourceDir.default"
40 pattern="[a-zA-Z0-9]+"
41 mandatory="true"
42 persist="true"/>
43 <property id="license" label="License" description="License" type="select" default="BSD" mandatory="false" persist="true">
44 <item label="BSD License" name="BSD"/>
45 <item label="MIT License" name="MIT"/>
46 <item label="GNU General Public License v2.0" name="GPLv2"/>
47 <item label="GNU General Public License v2.0_or_later" name="GPLv2_or_later"/>
48 <item label="GNU General Public License v3.0" name="GPLv3"/>
49 <item label="Other" name="Other"/>
50 </property>
51 </property-group>
52
53 <process type="org.yocto.sdk.ide.NewYoctoProject">
54 <simple name="name" value="$(projectName)" />
55 <simple name="artifactExtension" value="exe" />
56 <simple name="isCProject" value="true" />
57 <simple name="isEmptyProject" value="false" />
58 <simple name="isAutotoolsProject" value="true" />
59 <simple name="isCMakeProject" value="false" />
60 </process>
61
62 <process type="org.eclipse.cdt.core.CreateSourceFolder">
63 <simple name="projectName" value="$(projectName)"/>
64 <simple name="path" value="$(sourceDir)"/>
65 </process>
66
67 <process type="org.eclipse.cdt.core.AddFiles">
68 <simple name="projectName" value="$(projectName)"/>
69 <complex-array name="files">
70 <element>
71 <simple name="source" value="../Licenses/AUTHORS"/>
72 <simple name="target" value="AUTHORS"/>
73 <simple name="replaceable" value="true"/>
74 </element>
75 <element>
76 <simple name="source" value="../Licenses/COPYING_$(license)"/>
77 <simple name="target" value="COPYING"/>
78 <simple name="replaceable" value="true"/>
79 </element>
80 <element>
81 <simple name="source" value="../Licenses/Header_$(license)"/>
82 <simple name="target" value="$(sourceDir)/$(projectName).c"/>
83 <simple name="replaceable" value="true"/>
84 </element>
85 <element>
86 <simple name="source" value="src/autogen.sh"/>
87 <simple name="target" value="autogen.sh"/>
88 <simple name="replaceable" value="true"/>
89 </element>
90 <element>
91 <simple name="source" value="src/ChangeLog"/>
92 <simple name="target" value="ChangeLog"/>
93 <simple name="replaceable" value="true"/>
94 </element>
95 <element>
96 <simple name="source" value="src/configure.ac.top"/>
97 <simple name="target" value="configure.ac"/>
98 <simple name="replaceable" value="true"/>
99 </element>
100 <element>
101 <simple name="source" value="src/INSTALL"/>
102 <simple name="target" value="INSTALL"/>
103 <simple name="replaceable" value="true"/>
104 </element>
105 <element>
106 <simple name="source" value="src/Makefile.am.src"/>
107 <simple name="target" value="$(sourceDir)/Makefile.am"/>
108 <simple name="replaceable" value="true"/>
109 </element>
110 <element>
111 <simple name="source" value="src/Makefile.am.top"/>
112 <simple name="target" value="Makefile.am"/>
113 <simple name="replaceable" value="true"/>
114 </element>
115 <element>
116 <simple name="source" value="src/NEWS"/>
117 <simple name="target" value="NEWS"/>
118 <simple name="replaceable" value="true"/>
119 </element>
120 <element>
121 <simple name="source" value="src/README"/>
122 <simple name="target" value="README"/>
123 <simple name="replaceable" value="true"/>
124 </element>
125 </complex-array>
126 </process>
127
128 <process type="org.eclipse.cdt.core.AppendCreate">
129 <simple name="projectName" value="$(projectName)"/>
130 <complex-array name="files">
131 <element>
132 <simple name="source" value="src/Basename.c"/>
133 <simple name="target" value="$(sourceDir)/$(projectName).c"/>
134 <simple name="replaceable" value="true"/>
135 </element>
136 </complex-array>
137 </process>
138
139 <process type="org.yocto.sdk.ide.NewYoctoAutotoolsProjectPostProcess">
140 <simple name="projectName" value="$(projectName)" />
141 </process>
142
143</template>
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.c b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.c
new file mode 100644
index 0000000..e40fd64
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.c
@@ -0,0 +1,50 @@
1#include <gtk/gtk.h>
2
3static void
4hello (GtkWidget * widget, gpointer data)
5{
6 g_print ("Hello World!\n");
7}
8
9static gboolean
10delete_event (GtkWidget * widget, GdkEvent * event, gpointer data)
11{
12 g_print ("delete event occurred\n");
13 return TRUE;
14}
15
16static void
17destroy (GtkWidget * widget, gpointer data)
18{
19 gtk_main_quit ();
20}
21
22int
23main (int argc, char *argv[])
24{
25 GtkWidget *window;
26 GtkWidget *button;
27
28 gtk_init (&argc, &argv);
29 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
30
31 g_signal_connect (G_OBJECT (window), "delete_event",
32 G_CALLBACK (delete_event), NULL);
33 g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy), NULL);
34
35 gtk_container_set_border_width (GTK_CONTAINER (window), 10);
36 button = gtk_button_new_with_label ("Hello World!");
37
38 g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (hello), NULL);
39 g_signal_connect_swapped (G_OBJECT (button), "clicked",
40 G_CALLBACK (gtk_widget_destroy),
41 G_OBJECT (window));
42
43 gtk_container_add (GTK_CONTAINER (window), button);
44 gtk_widget_show (button);
45 gtk_widget_show (window);
46
47 gtk_main ();
48
49 return 0;
50}
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.desktop.in.src b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.desktop.in.src
new file mode 100644
index 0000000..e96420f
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Basename.desktop.in.src
@@ -0,0 +1,9 @@
1[Desktop Entry]
2Version=@VERSION@
3Encoding=UTF-8
4Name=$(projectName)
5Comment=A "$(message)"
6Type=Application
7Categories=Application
8Exec=$(projectName)
9Name[en_US]=$(message)
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/ChangeLog b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/ChangeLog
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/INSTALL b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/INSTALL
new file mode 100644
index 0000000..b8b0535
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/INSTALL
@@ -0,0 +1,9 @@
1Building:
2 $ ./autogen.sh [--enable-gtk-doc] [--prefix=/usr]
3 $ make
4
5Installing:
6 $ sudo make install
7
8Running:
9 $ $(projectName) \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.src b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.src
new file mode 100644
index 0000000..5ac2885
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.src
@@ -0,0 +1,8 @@
1
2bin_PROGRAMS = $(projectName)
3$(projectName)_SOURCES = $(projectName).c
4
5AM_CFLAGS = @$(projectName)_CFLAGS@
6AM_LDFLAGS = @$(projectName)_LIBS@
7
8CLEANFILES = *~
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.top
new file mode 100644
index 0000000..7bee2b7
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/Makefile.am.top
@@ -0,0 +1,7 @@
1SUBDIRS = $(sourceDir)
2
3MAINTAINERCLEANFILES = aclocal.m4 compile config.guess \
4 config.sub configure depcomp install-sh \
5 ltmain.sh Makefile.in missing
6
7
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/NEWS b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/NEWS
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/README b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/README
new file mode 100644
index 0000000..ec15541
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/README
@@ -0,0 +1,25 @@
1$(projectName)
2Copyright (C) $(copyright).
3
4Brief description of project....
5
6-----------------------------------------------------------------------------
7 Build
8-----------------------------------------------------------------------------
9$ ./autogen.sh $CONFIGURE_FLAGS
10$ make
11
12-----------------------------------------------------------------------------
13 Build with documentation generated (usually for libraries)
14-----------------------------------------------------------------------------
15$ ./autogen.sh --enable-gtk-doc
16$ make
17
18( If built with the --enable-gtk-doc flag above you can view the index.html
19 file in your web browser. )
20$ firefox ./docs/reference/index.html
21
22-----------------------------------------------------------------------------
23 Install
24-----------------------------------------------------------------------------
25$ sudo make install
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/autogen.sh b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/autogen.sh
new file mode 100755
index 0000000..7fd81e2
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/autogen.sh
@@ -0,0 +1,10 @@
1#! /bin/sh
2[ -e config.cache ] && rm -f config.cache
3
4libtoolize --automake
5aclocal ${OECORE_ACLOCAL_OPTS}
6autoconf
7autoheader
8automake -a
9./configure $@
10exit
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top
new file mode 100644
index 0000000..508bc13
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top
@@ -0,0 +1,49 @@
1AC_PREREQ(2.61)
2
3# package version number (not shared library version)
4# odd micro numbers indicate in-progress development
5# even micro numbers indicate released versions
6m4_define($(projectName)_version_major, 0)
7m4_define($(projectName)_version_minor, 1)
8m4_define($(projectName)_version_micro, 0)
9
10m4_define([$(projectName)_version],
11 [$(projectName)_version_major.$(projectName)_version_minor.$(projectName)_version_micro])
12m4_define([$(projectName)_api_version],
13 [$(projectName)_version_major.$(projectName)_version_minor])
14
15AC_INIT($(projectName), $(projectName)_version)
16AM_INIT_AUTOMAKE($(projectName), $(projectName)_version)
17AC_CONFIG_HEADERS(config.h)
18
19# Checks for programs.
20AC_PROG_LIBTOOL
21AM_PROG_CC_C_O
22AC_PROG_INSTALL
23
24#enable pkg-config
25PKG_PROG_PKG_CONFIG
26
27#GTK_REQUIRED_VERSION=2.0.0
28#GLIB_REQUIRED_VERSION=$GTK_REQUIRED_VERSION
29
30#AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION,,
31# [AC_MSG_ERROR(Test for GLib failed.)], gobject)
32#AM_PATH_GTK_2_0($GTK_REQUIRED_VERSION,,
33# [AC_MSG_ERROR(Test for GTK failed.)])
34PKG_CHECK_MODULES($(projectName), glib-2.0 gtk+-2.0)
35
36AC_SUBST($(projectName)_CFLAGS)
37AC_SUBST($(projectName)_LIBS)
38
39AC_OUTPUT([
40Makefile
41$(sourceDir)/Makefile
42])
43
44echo ""
45echo " $(projectName) $VERSION"
46echo " ====================="
47echo ""
48echo " To build the project, run \"make\""
49echo ""
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top.old b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top.old
new file mode 100644
index 0000000..234ab99
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/src/configure.ac.top.old
@@ -0,0 +1,37 @@
1AC_PREREQ(2.61)
2
3# package version number (not shared library version)
4# odd micro numbers indicate in-progress development
5# even micro numbers indicate released versions
6m4_define($(projectName)_version_major, 0)
7m4_define($(projectName)_version_minor, 1)
8m4_define($(projectName)_version_micro, 0)
9
10m4_define([$(projectName)_version],
11 [$(projectName)_version_major.$(projectName)_version_minor.$(projectName)_version_micro])
12m4_define([$(projectName)_api_version],
13 [$(projectName)_version_major.$(projectName)_version_minor])
14
15AC_INIT($(projectName), $(projectName)_version)
16AM_INIT_AUTOMAKE($(projectName), $(projectName)_version)
17AC_CONFIG_HEADERS(config.h)
18
19# Checks for programs.
20AC_PROG_LIBTOOL
21AM_PROG_CC_C_O
22AC_PROG_INSTALL
23
24AC_SUBST($(projectName)_CFLAGS)
25AC_SUBST($(projectName)_LIBS)
26
27AC_OUTPUT([
28Makefile
29$(sourceDir)/Makefile
30])
31
32echo ""
33echo " $(projectName) $VERSION"
34echo " ====================="
35echo ""
36echo " To build the project, run \"make\""
37echo ""
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.properties b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.properties
new file mode 100644
index 0000000..430c04d
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.properties
@@ -0,0 +1,28 @@
1###############################################################################
2# Copyright (c) 2007, 2009 Symbian Software Private Ltd. and others.
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
7#
8# Contributors:
9# Bala Torati (Symbian) - initial API and implementation
10# Red Hat Inc - modification to use with Autotools project
11###############################################################################
12
13#Template Default Values
14HelloWorld.CAnsitemplate.label=Hello World GTK C Autotools Project
15HelloWorld.CAnsitemplate.description=A skeletal C GTK Hello World project. Creates a folder for sources and autogen artifacts.
16HelloWorld.basics.label=Basic Settings
17HelloWorld.basics.description=Basic properties of a project
18HelloWorld.author.label=Author
19HelloWorld.author.description=Name of the author
20HelloWorld.copyright.label=Copyright notice
21HelloWorld.copyright.description=The name of the copyright holder (e.g. XYZ Corporation)
22HelloWorld.copyright.default=Your copyright
23HelloWorld.message.default=Hello World
24HelloWorld.message.description=Your hello world greeting message
25HelloWorld.message.label=Hello world greeting
26HelloWorld.sourceDir.label=Source
27HelloWorld.sourceDir.description=Directory for hello world project source files
28HelloWorld.sourceDir.default=src
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.xml b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.xml
new file mode 100644
index 0000000..4234ff4
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCGTKAutotoolsProject/template.xml
@@ -0,0 +1,142 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
3 copyright="Copyright (c) 2007,2009 Symbian Software Limited and others. 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 athttp://www.eclipse.org/legal/epl-v10.html"
4 id="YoctoHelloWorldCGTKAutotoolsProject" label="%HelloWorld.CAnsitemplate.label" description="%HelloWorld.CAnsitemplate.description"
5 help="help.html">
6
7 <property-group id="basics" label="%HelloWorld.basics.label" description="%HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
8 <property id="author"
9 label="%HelloWorld.author.label"
10 description="%HelloWorld.author.description"
11 type="input"
12 pattern=".+"
13 default=""
14 hidden="false"
15 mandatory="true"
16 persist="true"/>
17 <property id="copyright"
18 label="%HelloWorld.copyright.label"
19 description="%HelloWorld.copyright.description"
20 type="input"
21 pattern=".+"
22 default="%HelloWorld.copyright.default"
23 hidden="false"
24 mandatory="true"
25 persist="true"/>
26 <property id="message"
27 label="%HelloWorld.message.label"
28 description="%HelloWorld.message.description"
29 type="input"
30 pattern=".+"
31 default="%HelloWorld.message.default"
32 hidden="false"
33 mandatory="true"
34 persist="true"/>
35 <property id="sourceDir"
36 label="%HelloWorld.sourceDir.label"
37 description="%HelloWorld.sourceDir.description"
38 type="input"
39 default="%HelloWorld.sourceDir.default"
40 pattern="[a-zA-Z0-9]+"
41 mandatory="true"
42 persist="true"/>
43 <property id="license" label="License" description="License" type="select" default="BSD" mandatory="false" persist="true">
44 <item label="BSD License" name="BSD"/>
45 <item label="MIT License" name="MIT"/>
46 <item label="GNU General Public License v2.0" name="GPLv2"/>
47 <item label="GNU General Public License v2.0_or_later" name="GPLv2_or_later"/>
48 <item label="GNU General Public License v3.0" name="GPLv3"/>
49 <item label="Other" name="Other"/>
50 </property>
51 </property-group>
52
53 <process type="org.yocto.sdk.ide.NewYoctoProject">
54 <simple name="name" value="$(projectName)" />
55 <simple name="artifactExtension" value="exe" />
56 <simple name="isCProject" value="true" />
57 <simple name="isEmptyProject" value="false" />
58 <simple name="isAutotoolsProject" value="true" />
59 <simple name="isCMakeProject" value="false" />
60 </process>
61
62 <process type="org.eclipse.cdt.core.CreateSourceFolder">
63 <simple name="projectName" value="$(projectName)"/>
64 <simple name="path" value="$(sourceDir)"/>
65 </process>
66
67 <process type="org.eclipse.cdt.core.AddFiles">
68 <simple name="projectName" value="$(projectName)"/>
69 <complex-array name="files">
70 <element>
71 <simple name="source" value="../Licenses/AUTHORS"/>
72 <simple name="target" value="AUTHORS"/>
73 <simple name="replaceable" value="true"/>
74 </element>
75 <element>
76 <simple name="source" value="../Licenses/COPYING_$(license)"/>
77 <simple name="target" value="COPYING"/>
78 <simple name="replaceable" value="true"/>
79 </element>
80 <element>
81 <simple name="source" value="../Licenses/Header_$(license)"/>
82 <simple name="target" value="$(sourceDir)/$(projectName).c"/>
83 <simple name="replaceable" value="true"/>
84 </element>
85 <element>
86 <simple name="source" value="src/autogen.sh"/>
87 <simple name="target" value="autogen.sh"/>
88 <simple name="replaceable" value="true"/>
89 </element>
90 <element>
91 <simple name="source" value="src/ChangeLog"/>
92 <simple name="target" value="ChangeLog"/>
93 <simple name="replaceable" value="true"/>
94 </element>
95 <element>
96 <simple name="source" value="src/configure.ac.top"/>
97 <simple name="target" value="configure.ac"/>
98 <simple name="replaceable" value="true"/>
99 </element>
100 <element>
101 <simple name="source" value="src/INSTALL"/>
102 <simple name="target" value="INSTALL"/>
103 <simple name="replaceable" value="true"/>
104 </element>
105 <element>
106 <simple name="source" value="src/Makefile.am.src"/>
107 <simple name="target" value="$(sourceDir)/Makefile.am"/>
108 <simple name="replaceable" value="true"/>
109 </element>
110 <element>
111 <simple name="source" value="src/Makefile.am.top"/>
112 <simple name="target" value="Makefile.am"/>
113 <simple name="replaceable" value="true"/>
114 </element>
115 <element>
116 <simple name="source" value="src/NEWS"/>
117 <simple name="target" value="NEWS"/>
118 <simple name="replaceable" value="true"/>
119 </element>
120 <element>
121 <simple name="source" value="src/README"/>
122 <simple name="target" value="README"/>
123 <simple name="replaceable" value="true"/>
124 </element>
125 </complex-array>
126 </process>
127
128 <process type="org.eclipse.cdt.core.AppendCreate">
129 <simple name="projectName" value="$(projectName)"/>
130 <complex-array name="files">
131 <element>
132 <simple name="source" value="src/Basename.c"/>
133 <simple name="target" value="$(sourceDir)/$(projectName).c"/>
134 <simple name="replaceable" value="true"/>
135 </element>
136 </complex-array>
137 </process>
138
139 <process type="org.yocto.sdk.ide.NewYoctoAutotoolsProjectPostProcess">
140 <simple name="projectName" value="$(projectName)" />
141 </process>
142</template>
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp
new file mode 100644
index 0000000..986dd35
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp
@@ -0,0 +1,11 @@
1
2
3#include <iostream>
4
5using namespace std;
6
7int main(void) {
8 cout << "Hello World" << endl; /* prints Hello World */
9 return 0;
10}
11
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/INSTALL b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/INSTALL
new file mode 100644
index 0000000..b8b0535
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/INSTALL
@@ -0,0 +1,9 @@
1Building:
2 $ ./autogen.sh [--enable-gtk-doc] [--prefix=/usr]
3 $ make
4
5Installing:
6 $ sudo make install
7
8Running:
9 $ $(projectName) \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src
new file mode 100644
index 0000000..1ea3308
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src
@@ -0,0 +1,8 @@
1
2bin_PROGRAMS = $(projectName)
3$(projectName)_SOURCES = $(projectName).cpp
4
5AM_CXXFLAGS = @$(projectName)_CFLAGS@
6AM_LDFLAGS = @$(projectName)_LIBS@
7
8CLEANFILES = *~
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top
new file mode 100644
index 0000000..6060599
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top
@@ -0,0 +1,6 @@
1EXTRA_DIST = autogen.sh
2SUBDIRS = $(sourceDir)
3
4DISTCHECK_CONFIGURE_FLAGS=
5
6CLEANFILES = *~ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README
new file mode 100644
index 0000000..ec15541
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README
@@ -0,0 +1,25 @@
1$(projectName)
2Copyright (C) $(copyright).
3
4Brief description of project....
5
6-----------------------------------------------------------------------------
7 Build
8-----------------------------------------------------------------------------
9$ ./autogen.sh $CONFIGURE_FLAGS
10$ make
11
12-----------------------------------------------------------------------------
13 Build with documentation generated (usually for libraries)
14-----------------------------------------------------------------------------
15$ ./autogen.sh --enable-gtk-doc
16$ make
17
18( If built with the --enable-gtk-doc flag above you can view the index.html
19 file in your web browser. )
20$ firefox ./docs/reference/index.html
21
22-----------------------------------------------------------------------------
23 Install
24-----------------------------------------------------------------------------
25$ sudo make install
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/autogen.sh b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/autogen.sh
new file mode 100755
index 0000000..7fd81e2
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/autogen.sh
@@ -0,0 +1,10 @@
1#! /bin/sh
2[ -e config.cache ] && rm -f config.cache
3
4libtoolize --automake
5aclocal ${OECORE_ACLOCAL_OPTS}
6autoconf
7autoheader
8automake -a
9./configure $@
10exit
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top
new file mode 100644
index 0000000..5cc622b
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top
@@ -0,0 +1,47 @@
1AC_PREREQ(2.61)
2
3# package version number (not shared library version)
4# odd micro numbers indicate in-progress development
5# even micro numbers indicate released versions
6m4_define($(projectName)_version_major, 0)
7m4_define($(projectName)_version_minor, 1)
8m4_define($(projectName)_version_micro, 0)
9
10m4_define([$(projectName)_version],
11 [$(projectName)_version_major.$(projectName)_version_minor.$(projectName)_version_micro])
12m4_define([$(projectName)_api_version],
13 [$(projectName)_version_major.$(projectName)_version_minor])
14
15AC_INIT($(projectName), $(projectName)_version)
16AM_INIT_AUTOMAKE($(projectName), $(projectName)_version)
17AC_CONFIG_HEADERS(config.h)
18
19# Checks for programs.
20AC_PROG_LIBTOOL
21AC_PROG_CXX
22AC_PROG_INSTALL
23
24# enable pkg-config
25PKG_PROG_PKG_CONFIG
26
27# Checks for library functions.
28#AC_CHECK_FUNCS([memset])
29
30AC_SUBST($(projectName)_CFLAGS)
31AC_SUBST($(projectName)_LIBS)
32
33
34#icondir=${datadir}/icons/hicolor/32x32/apps
35#AC_SUBST(icondir)
36
37AC_OUTPUT([
38Makefile
39$(sourceDir)/Makefile
40])
41
42echo ""
43echo " $(projectName) $VERSION"
44echo " ====================="
45echo ""
46echo " To build the project, run \"make\""
47echo ""
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties
new file mode 100644
index 0000000..0534ca6
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties
@@ -0,0 +1,28 @@
1###############################################################################
2# Copyright (c) 2007, 2009 Symbian Software Private Ltd. and others.
3# All rights reserved. This program and the accompanying materials
4# are made available under the terms of the Eclipse Public License v1.0
5# which accompanies this distribution, and is available at
6# http://www.eclipse.org/legal/epl-v10.html
7#
8# Contributors:
9# Bala Torati (Symbian) - initial API and implementation
10# Red Hat Inc - modification to use with Autotools project
11###############################################################################
12
13#Template Default Values
14HelloWorld.CCtemplate.label= Hello World C++ Autotools Project
15HelloWorld.CCtemplate.description=A skeletal C++ Hello World project. Creates a folder for sources and autogen artifacts.
16HelloWorld.basics.label=Basic Settings
17HelloWorld.basics.description=Basic properties of a project
18HelloWorld.author.label=Author
19HelloWorld.author.description=Name of the author
20HelloWorld.copyright.label=Copyright notice
21HelloWorld.copyright.description=The name of the copyright holder (e.g. XYZ Corporation)
22HelloWorld.copyright.default=Your copyright notice
23HelloWorld.message.default=Hello World
24HelloWorld.message.description=Your hello world greeting message
25HelloWorld.message.label=Hello world greeting
26HelloWorld.sourceDir.label=Source
27HelloWorld.sourceDir.description=Directory for hello world project source files
28HelloWorld.sourceDir.default=src
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml
new file mode 100644
index 0000000..2bf76bf
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml
@@ -0,0 +1,142 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
3 copyright="Copyright (c) 2007,2009 Symbian Software Limited and others. 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 athttp://www.eclipse.org/legal/epl-v10.html"
4 id="YoctoHelloWorldCPPAutotoolsProject" label="%HelloWorld.CCtemplate.label" description="%HelloWorld.CCtemplate.description"
5 help="help.html">
6
7 <property-group id="basics" label="%HelloWorld.basics.label" description="%HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
8 <property id="author"
9 label="%HelloWorld.author.label"
10 description="%HelloWorld.author.description"
11 type="input"
12 pattern=".+"
13 default=""
14 hidden="false"
15 mandatory="true"
16 persist="true"/>
17 <property id="copyright"
18 label="%HelloWorld.copyright.label"
19 description="%HelloWorld.copyright.description"
20 type="input"
21 pattern=".+"
22 default="%HelloWorld.copyright.default"
23 hidden="false"
24 mandatory="true"
25 persist="true"/>
26 <property id="message"
27 label="%HelloWorld.message.label"
28 description="%HelloWorld.message.description"
29 type="input"
30 pattern=".+"
31 default="%HelloWorld.message.default"
32 hidden="false"
33 mandatory="true"
34 persist="true"/>
35 <property id="sourceDir"
36 label="%HelloWorld.sourceDir.label"
37 description="%HelloWorld.sourceDir.description"
38 type="input"
39 default="%HelloWorld.sourceDir.default"
40 pattern="[a-zA-Z0-9]+"
41 mandatory="true"
42 persist="true"/>
43 <property id="license" label="License" description="License" type="select" default="BSD" mandatory="false" persist="true">
44 <item label="BSD License" name="BSD"/>
45 <item label="MIT License" name="MIT"/>
46 <item label="GNU General Public License v2.0" name="GPLv2"/>
47 <item label="GNU General Public License v2.0_or_later" name="GPLv2_or_later"/>
48 <item label="GNU General Public License v3.0" name="GPLv3"/>
49 <item label="Other" name="Other"/>
50 </property>
51 </property-group>
52
53 <process type="org.yocto.sdk.ide.NewYoctoProject">
54 <simple name="name" value="$(projectName)" />
55 <simple name="artifactExtension" value="exe" />
56 <simple name="isCProject" value="false" />
57 <simple name="isEmptyProject" value="false" />
58 <simple name="isAutotoolsProject" value="true" />
59 <simple name="isCMakeProject" value="false" />
60 </process>
61
62 <process type="org.eclipse.cdt.core.CreateSourceFolder">
63 <simple name="projectName" value="$(projectName)"/>
64 <simple name="path" value="$(sourceDir)"/>
65 </process>
66
67 <process type="org.eclipse.cdt.core.AddFiles">
68 <simple name="projectName" value="$(projectName)"/>
69 <complex-array name="files">
70 <element>
71 <simple name="source" value="../Licenses/AUTHORS"/>
72 <simple name="target" value="AUTHORS"/>
73 <simple name="replaceable" value="true"/>
74 </element>
75 <element>
76 <simple name="source" value="../Licenses/COPYING_$(license)"/>
77 <simple name="target" value="COPYING"/>
78 <simple name="replaceable" value="true"/>
79 </element>
80 <element>
81 <simple name="source" value="../Licenses/Header_$(license)"/>
82 <simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
83 <simple name="replaceable" value="true"/>
84 </element>
85 <element>
86 <simple name="source" value="src/autogen.sh"/>
87 <simple name="target" value="autogen.sh"/>
88 <simple name="replaceable" value="true"/>
89 </element>
90 <element>
91 <simple name="source" value="src/ChangeLog"/>
92 <simple name="target" value="ChangeLog"/>
93 <simple name="replaceable" value="true"/>
94 </element>
95 <element>
96 <simple name="source" value="src/configure.ac.top"/>
97 <simple name="target" value="configure.ac"/>
98 <simple name="replaceable" value="true"/>
99 </element>
100 <element>
101 <simple name="source" value="src/INSTALL"/>
102 <simple name="target" value="INSTALL"/>
103 <simple name="replaceable" value="true"/>
104 </element>
105 <element>
106 <simple name="source" value="src/Makefile.am.src"/>
107 <simple name="target" value="$(sourceDir)/Makefile.am"/>
108 <simple name="replaceable" value="true"/>
109 </element>
110 <element>
111 <simple name="source" value="src/Makefile.am.top"/>
112 <simple name="target" value="Makefile.am"/>
113 <simple name="replaceable" value="true"/>
114 </element>
115 <element>
116 <simple name="source" value="src/NEWS"/>
117 <simple name="target" value="NEWS"/>
118 <simple name="replaceable" value="true"/>
119 </element>
120 <element>
121 <simple name="source" value="src/README"/>
122 <simple name="target" value="README"/>
123 <simple name="replaceable" value="true"/>
124 </element>
125 </complex-array>
126 </process>
127
128 <process type="org.eclipse.cdt.core.AppendCreate">
129 <simple name="projectName" value="$(projectName)"/>
130 <complex-array name="files">
131 <element>
132 <simple name="source" value="src/Basename.cpp"/>
133 <simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
134 <simple name="replaceable" value="true"/>
135 </element>
136 </complex-array>
137 </process>
138
139 <process type="org.yocto.sdk.ide.NewYoctoAutotoolsProjectPostProcess">
140 <simple name="projectName" value="$(projectName)" />
141 </process>
142</template>
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/AUTHORS b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/AUTHORS
new file mode 100644
index 0000000..9d38b85
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/AUTHORS
@@ -0,0 +1 @@
$(author)
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_BSD b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_BSD
new file mode 100644
index 0000000..064c1cc
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_BSD
@@ -0,0 +1,24 @@
1All rights reserved.
2
3Redistribution and use in source and binary forms, with or without
4modification, are permitted provided that the following conditions are met:
5
6 * Redistributions of source code must retain the above copyright
7 notice, this list of conditions and the following disclaimer.
8 * Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 * Neither the name of PG_ORGANIZATION nor the
12 names of its contributors may be used to endorse or promote products
13 derived from this software without specific prior written permission.
14
15THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2
new file mode 100644
index 0000000..c6eecf2
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; version 2 of the License.
299
300 This program is distributed in the hope that it will be useful,
301 but WITHOUT ANY WARRANTY; without even the implied warranty of
302 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
303 GNU General Public License for more details.
304
305 You should have received a copy of the GNU General Public License
306 along with this program; if not, write to the Free Software
307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
308
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Library General
339Public License instead of this License. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2_or_later b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2_or_later
new file mode 100644
index 0000000..0f70665
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv2_or_later
@@ -0,0 +1,340 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Library General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License
307 along with this program; if not, write to the Free Software
308 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
309
310
311Also add information on how to contact you by electronic and paper mail.
312
313If the program is interactive, make it output a short notice like this
314when it starts in an interactive mode:
315
316 Gnomovision version 69, Copyright (C) year name of author
317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 This is free software, and you are welcome to redistribute it
319 under certain conditions; type `show c' for details.
320
321The hypothetical commands `show w' and `show c' should show the appropriate
322parts of the General Public License. Of course, the commands you use may
323be called something other than `show w' and `show c'; they could even be
324mouse-clicks or menu items--whatever suits your program.
325
326You should also get your employer (if you work as a programmer) or your
327school, if any, to sign a "copyright disclaimer" for the program, if
328necessary. Here is a sample; alter the names:
329
330 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331 `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
333 <signature of Ty Coon>, 1 April 1989
334 Ty Coon, President of Vice
335
336This General Public License does not permit incorporating your program into
337proprietary programs. If your program is a subroutine library, you may
338consider it more useful to permit linking proprietary applications with the
339library. If this is what you want to do, use the GNU Library General
340Public License instead of this License. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv3 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv3
new file mode 100644
index 0000000..20d40b6
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_GPLv3
@@ -0,0 +1,674 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14to take away your freedom to share and change the works. By contrast,
15the GNU General Public License is intended to guarantee your freedom to
16share and change all versions of a program--to make sure it remains free
17software for all its users. We, the Free Software Foundation, use the
18GNU General Public License for most of our software; it applies also to
19any other work released this way by its authors. You can apply it to
20your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv2.1 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv2.1
new file mode 100644
index 0000000..fc3ffda
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv2.1
@@ -0,0 +1,502 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9[This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16freedom to share and change it. By contrast, the GNU General Public
17Licenses are intended to guarantee your freedom to share and change
18free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21specially designated software packages--typically libraries--of the
22Free Software Foundation and other authors who decide to use it. You
23can use it too, but we suggest you first think carefully about whether
24this license or the ordinary General Public License is the better
25strategy to use in any particular case, based on the explanations below.
26
27 When we speak of free software, we are referring to freedom of use,
28not price. Our General Public Licenses are designed to make sure that
29you have the freedom to distribute copies of free software (and charge
30for this service if you wish); that you receive source code or can get
31it if you want it; that you can change the software and use pieces of
32it in new free programs; and that you are informed that you can do
33these things.
34
35 To protect your rights, we need to make restrictions that forbid
36distributors to deny you these rights or to ask you to surrender these
37rights. These restrictions translate to certain responsibilities for
38you if you distribute copies of the library or if you modify it.
39
40 For example, if you distribute copies of the library, whether gratis
41or for a fee, you must give the recipients all the rights that we gave
42you. You must make sure that they, too, receive or can get the source
43code. If you link other code with the library, you must provide
44complete object files to the recipients, so that they can relink them
45with the library after making changes to the library and recompiling
46it. And you must show them these terms so they know their rights.
47
48 We protect your rights with a two-step method: (1) we copyright the
49library, and (2) we offer you this license, which gives you legal
50permission to copy, distribute and/or modify the library.
51
52 To protect each distributor, we want to make it very clear that
53there is no warranty for the free library. Also, if the library is
54modified by someone else and passed on, the recipients should know
55that what they have is not the original version, so that the original
56author's reputation will not be affected by problems that might be
57introduced by others.
58
59 Finally, software patents pose a constant threat to the existence of
60any free program. We wish to make sure that a company cannot
61effectively restrict the users of a free program by obtaining a
62restrictive license from a patent holder. Therefore, we insist that
63any patent license obtained for a version of the library must be
64consistent with the full freedom of use specified in this license.
65
66 Most GNU software, including some libraries, is covered by the
67ordinary GNU General Public License. This license, the GNU Lesser
68General Public License, applies to certain designated libraries, and
69is quite different from the ordinary General Public License. We use
70this license for certain libraries in order to permit linking those
71libraries into non-free programs.
72
73 When a program is linked with a library, whether statically or using
74a shared library, the combination of the two is legally speaking a
75combined work, a derivative of the original library. The ordinary
76General Public License therefore permits such linking only if the
77entire combination fits its criteria of freedom. The Lesser General
78Public License permits more lax criteria for linking other code with
79the library.
80
81 We call this license the "Lesser" General Public License because it
82does Less to protect the user's freedom than the ordinary General
83Public License. It also provides other free software developers Less
84of an advantage over competing non-free programs. These disadvantages
85are the reason we use the ordinary General Public License for many
86libraries. However, the Lesser license provides advantages in certain
87special circumstances.
88
89 For example, on rare occasions, there may be a special need to
90encourage the widest possible use of a certain library, so that it becomes
91a de-facto standard. To achieve this, non-free programs must be
92allowed to use the library. A more frequent case is that a free
93library does the same job as widely used non-free libraries. In this
94case, there is little to gain by limiting the free library to free
95software only, so we use the Lesser General Public License.
96
97 In other cases, permission to use a particular library in non-free
98programs enables a greater number of people to use a large body of
99free software. For example, permission to use the GNU C Library in
100non-free programs enables many more people to use the whole GNU
101operating system, as well as its variant, the GNU/Linux operating
102system.
103
104 Although the Lesser General Public License is Less protective of the
105users' freedom, it does ensure that the user of a program that is
106linked with the Library has the freedom and the wherewithal to run
107that program using a modified version of the Library.
108
109 The precise terms and conditions for copying, distribution and
110modification follow. Pay close attention to the difference between a
111"work based on the library" and a "work that uses the library". The
112former contains code derived from the library, whereas the latter must
113be combined with the library in order to run.
114
115 GNU LESSER GENERAL PUBLIC LICENSE
116 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
118 0. This License Agreement applies to any software library or other
119program which contains a notice placed by the copyright holder or
120other authorized party saying it may be distributed under the terms of
121this Lesser General Public License (also called "this License").
122Each licensee is addressed as "you".
123
124 A "library" means a collection of software functions and/or data
125prepared so as to be conveniently linked with application programs
126(which use some of those functions and data) to form executables.
127
128 The "Library", below, refers to any such software library or work
129which has been distributed under these terms. A "work based on the
130Library" means either the Library or any derivative work under
131copyright law: that is to say, a work containing the Library or a
132portion of it, either verbatim or with modifications and/or translated
133straightforwardly into another language. (Hereinafter, translation is
134included without limitation in the term "modification".)
135
136 "Source code" for a work means the preferred form of the work for
137making modifications to it. For a library, complete source code means
138all the source code for all modules it contains, plus any associated
139interface definition files, plus the scripts used to control compilation
140and installation of the library.
141
142 Activities other than copying, distribution and modification are not
143covered by this License; they are outside its scope. The act of
144running a program using the Library is not restricted, and output from
145such a program is covered only if its contents constitute a work based
146on the Library (independent of the use of the Library in a tool for
147writing it). Whether that is true depends on what the Library does
148and what the program that uses the Library does.
149
150 1. You may copy and distribute verbatim copies of the Library's
151complete source code as you receive it, in any medium, provided that
152you conspicuously and appropriately publish on each copy an
153appropriate copyright notice and disclaimer of warranty; keep intact
154all the notices that refer to this License and to the absence of any
155warranty; and distribute a copy of this License along with the
156Library.
157
158 You may charge a fee for the physical act of transferring a copy,
159and you may at your option offer warranty protection in exchange for a
160fee.
161
162 2. You may modify your copy or copies of the Library or any portion
163of it, thus forming a work based on the Library, and copy and
164distribute such modifications or work under the terms of Section 1
165above, provided that you also meet all of these conditions:
166
167 a) The modified work must itself be a software library.
168
169 b) You must cause the files modified to carry prominent notices
170 stating that you changed the files and the date of any change.
171
172 c) You must cause the whole of the work to be licensed at no
173 charge to all third parties under the terms of this License.
174
175 d) If a facility in the modified Library refers to a function or a
176 table of data to be supplied by an application program that uses
177 the facility, other than as an argument passed when the facility
178 is invoked, then you must make a good faith effort to ensure that,
179 in the event an application does not supply such function or
180 table, the facility still operates, and performs whatever part of
181 its purpose remains meaningful.
182
183 (For example, a function in a library to compute square roots has
184 a purpose that is entirely well-defined independent of the
185 application. Therefore, Subsection 2d requires that any
186 application-supplied function or table used by this function must
187 be optional: if the application does not supply it, the square
188 root function must still compute square roots.)
189
190These requirements apply to the modified work as a whole. If
191identifiable sections of that work are not derived from the Library,
192and can be reasonably considered independent and separate works in
193themselves, then this License, and its terms, do not apply to those
194sections when you distribute them as separate works. But when you
195distribute the same sections as part of a whole which is a work based
196on the Library, the distribution of the whole must be on the terms of
197this License, whose permissions for other licensees extend to the
198entire whole, and thus to each and every part regardless of who wrote
199it.
200
201Thus, it is not the intent of this section to claim rights or contest
202your rights to work written entirely by you; rather, the intent is to
203exercise the right to control the distribution of derivative or
204collective works based on the Library.
205
206In addition, mere aggregation of another work not based on the Library
207with the Library (or with a work based on the Library) on a volume of
208a storage or distribution medium does not bring the other work under
209the scope of this License.
210
211 3. You may opt to apply the terms of the ordinary GNU General Public
212License instead of this License to a given copy of the Library. To do
213this, you must alter all the notices that refer to this License, so
214that they refer to the ordinary GNU General Public License, version 2,
215instead of to this License. (If a newer version than version 2 of the
216ordinary GNU General Public License has appeared, then you can specify
217that version instead if you wish.) Do not make any other change in
218these notices.
219
220 Once this change is made in a given copy, it is irreversible for
221that copy, so the ordinary GNU General Public License applies to all
222subsequent copies and derivative works made from that copy.
223
224 This option is useful when you wish to copy part of the code of
225the Library into a program that is not a library.
226
227 4. You may copy and distribute the Library (or a portion or
228derivative of it, under Section 2) in object code or executable form
229under the terms of Sections 1 and 2 above provided that you accompany
230it with the complete corresponding machine-readable source code, which
231must be distributed under the terms of Sections 1 and 2 above on a
232medium customarily used for software interchange.
233
234 If distribution of object code is made by offering access to copy
235from a designated place, then offering equivalent access to copy the
236source code from the same place satisfies the requirement to
237distribute the source code, even though third parties are not
238compelled to copy the source along with the object code.
239
240 5. A program that contains no derivative of any portion of the
241Library, but is designed to work with the Library by being compiled or
242linked with it, is called a "work that uses the Library". Such a
243work, in isolation, is not a derivative work of the Library, and
244therefore falls outside the scope of this License.
245
246 However, linking a "work that uses the Library" with the Library
247creates an executable that is a derivative of the Library (because it
248contains portions of the Library), rather than a "work that uses the
249library". The executable is therefore covered by this License.
250Section 6 states terms for distribution of such executables.
251
252 When a "work that uses the Library" uses material from a header file
253that is part of the Library, the object code for the work may be a
254derivative work of the Library even though the source code is not.
255Whether this is true is especially significant if the work can be
256linked without the Library, or if the work is itself a library. The
257threshold for this to be true is not precisely defined by law.
258
259 If such an object file uses only numerical parameters, data
260structure layouts and accessors, and small macros and small inline
261functions (ten lines or less in length), then the use of the object
262file is unrestricted, regardless of whether it is legally a derivative
263work. (Executables containing this object code plus portions of the
264Library will still fall under Section 6.)
265
266 Otherwise, if the work is a derivative of the Library, you may
267distribute the object code for the work under the terms of Section 6.
268Any executables containing that work also fall under Section 6,
269whether or not they are linked directly with the Library itself.
270
271 6. As an exception to the Sections above, you may also combine or
272link a "work that uses the Library" with the Library to produce a
273work containing portions of the Library, and distribute that work
274under terms of your choice, provided that the terms permit
275modification of the work for the customer's own use and reverse
276engineering for debugging such modifications.
277
278 You must give prominent notice with each copy of the work that the
279Library is used in it and that the Library and its use are covered by
280this License. You must supply a copy of this License. If the work
281during execution displays copyright notices, you must include the
282copyright notice for the Library among them, as well as a reference
283directing the user to the copy of this License. Also, you must do one
284of these things:
285
286 a) Accompany the work with the complete corresponding
287 machine-readable source code for the Library including whatever
288 changes were used in the work (which must be distributed under
289 Sections 1 and 2 above); and, if the work is an executable linked
290 with the Library, with the complete machine-readable "work that
291 uses the Library", as object code and/or source code, so that the
292 user can modify the Library and then relink to produce a modified
293 executable containing the modified Library. (It is understood
294 that the user who changes the contents of definitions files in the
295 Library will not necessarily be able to recompile the application
296 to use the modified definitions.)
297
298 b) Use a suitable shared library mechanism for linking with the
299 Library. A suitable mechanism is one that (1) uses at run time a
300 copy of the library already present on the user's computer system,
301 rather than copying library functions into the executable, and (2)
302 will operate properly with a modified version of the library, if
303 the user installs one, as long as the modified version is
304 interface-compatible with the version that the work was made with.
305
306 c) Accompany the work with a written offer, valid for at
307 least three years, to give the same user the materials
308 specified in Subsection 6a, above, for a charge no more
309 than the cost of performing this distribution.
310
311 d) If distribution of the work is made by offering access to copy
312 from a designated place, offer equivalent access to copy the above
313 specified materials from the same place.
314
315 e) Verify that the user has already received a copy of these
316 materials or that you have already sent this user a copy.
317
318 For an executable, the required form of the "work that uses the
319Library" must include any data and utility programs needed for
320reproducing the executable from it. However, as a special exception,
321the materials to be distributed need not include anything that is
322normally distributed (in either source or binary form) with the major
323components (compiler, kernel, and so on) of the operating system on
324which the executable runs, unless that component itself accompanies
325the executable.
326
327 It may happen that this requirement contradicts the license
328restrictions of other proprietary libraries that do not normally
329accompany the operating system. Such a contradiction means you cannot
330use both them and the Library together in an executable that you
331distribute.
332
333 7. You may place library facilities that are a work based on the
334Library side-by-side in a single library together with other library
335facilities not covered by this License, and distribute such a combined
336library, provided that the separate distribution of the work based on
337the Library and of the other library facilities is otherwise
338permitted, and provided that you do these two things:
339
340 a) Accompany the combined library with a copy of the same work
341 based on the Library, uncombined with any other library
342 facilities. This must be distributed under the terms of the
343 Sections above.
344
345 b) Give prominent notice with the combined library of the fact
346 that part of it is a work based on the Library, and explaining
347 where to find the accompanying uncombined form of the same work.
348
349 8. You may not copy, modify, sublicense, link with, or distribute
350the Library except as expressly provided under this License. Any
351attempt otherwise to copy, modify, sublicense, link with, or
352distribute the Library is void, and will automatically terminate your
353rights under this License. However, parties who have received copies,
354or rights, from you under this License will not have their licenses
355terminated so long as such parties remain in full compliance.
356
357 9. You are not required to accept this License, since you have not
358signed it. However, nothing else grants you permission to modify or
359distribute the Library or its derivative works. These actions are
360prohibited by law if you do not accept this License. Therefore, by
361modifying or distributing the Library (or any work based on the
362Library), you indicate your acceptance of this License to do so, and
363all its terms and conditions for copying, distributing or modifying
364the Library or works based on it.
365
366 10. Each time you redistribute the Library (or any work based on the
367Library), the recipient automatically receives a license from the
368original licensor to copy, distribute, link with or modify the Library
369subject to these terms and conditions. You may not impose any further
370restrictions on the recipients' exercise of the rights granted herein.
371You are not responsible for enforcing compliance by third parties with
372this License.
373
374 11. If, as a consequence of a court judgment or allegation of patent
375infringement or for any other reason (not limited to patent issues),
376conditions are imposed on you (whether by court order, agreement or
377otherwise) that contradict the conditions of this License, they do not
378excuse you from the conditions of this License. If you cannot
379distribute so as to satisfy simultaneously your obligations under this
380License and any other pertinent obligations, then as a consequence you
381may not distribute the Library at all. For example, if a patent
382license would not permit royalty-free redistribution of the Library by
383all those who receive copies directly or indirectly through you, then
384the only way you could satisfy both it and this License would be to
385refrain entirely from distribution of the Library.
386
387If any portion of this section is held invalid or unenforceable under any
388particular circumstance, the balance of the section is intended to apply,
389and the section as a whole is intended to apply in other circumstances.
390
391It is not the purpose of this section to induce you to infringe any
392patents or other property right claims or to contest validity of any
393such claims; this section has the sole purpose of protecting the
394integrity of the free software distribution system which is
395implemented by public license practices. Many people have made
396generous contributions to the wide range of software distributed
397through that system in reliance on consistent application of that
398system; it is up to the author/donor to decide if he or she is willing
399to distribute software through any other system and a licensee cannot
400impose that choice.
401
402This section is intended to make thoroughly clear what is believed to
403be a consequence of the rest of this License.
404
405 12. If the distribution and/or use of the Library is restricted in
406certain countries either by patents or by copyrighted interfaces, the
407original copyright holder who places the Library under this License may add
408an explicit geographical distribution limitation excluding those countries,
409so that distribution is permitted only in or among countries not thus
410excluded. In such case, this License incorporates the limitation as if
411written in the body of this License.
412
413 13. The Free Software Foundation may publish revised and/or new
414versions of the Lesser General Public License from time to time.
415Such new versions will be similar in spirit to the present version,
416but may differ in detail to address new problems or concerns.
417
418Each version is given a distinguishing version number. If the Library
419specifies a version number of this License which applies to it and
420"any later version", you have the option of following the terms and
421conditions either of that version or of any later version published by
422the Free Software Foundation. If the Library does not specify a
423license version number, you may choose any version ever published by
424the Free Software Foundation.
425
426 14. If you wish to incorporate parts of the Library into other free
427programs whose distribution conditions are incompatible with these,
428write to the author to ask for permission. For software which is
429copyrighted by the Free Software Foundation, write to the Free
430Software Foundation; we sometimes make exceptions for this. Our
431decision will be guided by the two goals of preserving the free status
432of all derivatives of our free software and of promoting the sharing
433and reuse of software generally.
434
435 NO WARRANTY
436
437 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
447 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456DAMAGES.
457
458 END OF TERMS AND CONDITIONS
459
460 How to Apply These Terms to Your New Libraries
461
462 If you develop a new library, and you want it to be of the greatest
463possible use to the public, we recommend making it free software that
464everyone can redistribute and change. You can do so by permitting
465redistribution under these terms (or, alternatively, under the terms of the
466ordinary General Public License).
467
468 To apply these terms, attach the following notices to the library. It is
469safest to attach them to the start of each source file to most effectively
470convey the exclusion of warranty; and each file should have at least the
471"copyright" line and a pointer to where the full notice is found.
472
473 <one line to give the library's name and a brief idea of what it does.>
474 Copyright (C) <year> <name of author>
475
476 This library is free software; you can redistribute it and/or
477 modify it under the terms of the GNU Lesser General Public
478 License as published by the Free Software Foundation; either
479 version 2.1 of the License, or (at your option) any later version.
480
481 This library is distributed in the hope that it will be useful,
482 but WITHOUT ANY WARRANTY; without even the implied warranty of
483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
484 Lesser General Public License for more details.
485
486 You should have received a copy of the GNU Lesser General Public
487 License along with this library; if not, write to the Free Software
488 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
489
490Also add information on how to contact you by electronic and paper mail.
491
492You should also get your employer (if you work as a programmer) or your
493school, if any, to sign a "copyright disclaimer" for the library, if
494necessary. Here is a sample; alter the names:
495
496 Yoyodyne, Inc., hereby disclaims all copyright interest in the
497 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
499 <signature of Ty Coon>, 1 April 1990
500 Ty Coon, President of Vice
501
502That's all there is to it! \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv3 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv3
new file mode 100644
index 0000000..3f9959f
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_LGPLv3
@@ -0,0 +1,165 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the event an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatever part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and reverse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License ever published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_MIT b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_MIT
new file mode 100644
index 0000000..d827307
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_MIT
@@ -0,0 +1,19 @@
1All rights reserved.
2
3Permission is hereby granted, free of charge, to any person obtaining a copy
4of this software and associated documentation files (the "Software"), to deal
5in the Software without restriction, including without limitation the rights
6to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7copies of the Software, and to permit persons to whom the Software is
8furnished to do so, subject to the following conditions:
9
10The above copyright notice and this permission notice shall be included in
11all copies or substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19THE SOFTWARE. \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_Other b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_Other
new file mode 100644
index 0000000..54c4590
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/COPYING_Other
@@ -0,0 +1 @@
<Place your desired license here.> \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_BSD b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_BSD
new file mode 100644
index 0000000..14bdd06
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_BSD
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of the PG_ORGANIZATION nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS-IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2
new file mode 100644
index 0000000..591c14e
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc., 59
18 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2_or_later b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2_or_later
new file mode 100644
index 0000000..0dae49f
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv2_or_later
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv3 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv3
new file mode 100644
index 0000000..c7953e5
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_GPLv3
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv2.1 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv2.1
new file mode 100644
index 0000000..40a9603
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv2.1
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv3 b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv3
new file mode 100644
index 0000000..2581a03
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_LGPLv3
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 3 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_MIT b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_MIT
new file mode 100644
index 0000000..0ee5519
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_MIT
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 */ \ No newline at end of file
diff --git a/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_Other b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_Other
new file mode 100644
index 0000000..1f28ac0
--- /dev/null
+++ b/plugins/org.yocto.sdk.ide/templates/projecttemplates/Licenses/Header_Other
@@ -0,0 +1,9 @@
1/*
2 * Copyright (C) $(copyright).
3 *
4 * Author: $(author)
5 *
6 *
7 * Your desired license
8 *
9 */ \ No newline at end of file