diff options
author | Alena Laskavaia | 2010-03-18 14:33:13 +0000 |
---|---|---|
committer | Alena Laskavaia | 2010-03-18 14:33:13 +0000 |
commit | bad558e232093b7b985eed2f96a171f685a4b9f3 (patch) | |
tree | 06c83e68fdbf8f6b315e928bfe04d66b2315d8e0 | |
parent | 5cc82d793ac09b5ace108d842a52ad4b92a4e918 (diff) | |
download | org.eclipse.cdt-bad558e232093b7b985eed2f96a171f685a4b9f3.tar.gz org.eclipse.cdt-bad558e232093b7b985eed2f96a171f685a4b9f3.tar.xz org.eclipse.cdt-bad558e232093b7b985eed2f96a171f685a4b9f3.zip |
- extracted example from real checkers
-rw-r--r-- | codan/org.eclipse.cdt.codan.checkers/plugin.xml | 13 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/.classpath | 7 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/.project | 34 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/.settings/org.eclipse.jdt.core.prefs | 8 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/META-INF/MANIFEST.MF | 14 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/build.properties | 5 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/plugin.xml | 22 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/Activator.java | 50 | ||||
-rw-r--r-- | codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java (renamed from codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java) | 4 |
9 files changed, 142 insertions, 15 deletions
diff --git a/codan/org.eclipse.cdt.codan.checkers/plugin.xml b/codan/org.eclipse.cdt.codan.checkers/plugin.xml index e019352d7dd..475282f23c5 100644 --- a/codan/org.eclipse.cdt.codan.checkers/plugin.xml +++ b/codan/org.eclipse.cdt.codan.checkers/plugin.xml @@ -63,18 +63,5 @@ name="Suggested parenthesis around expression"> </problem> </checker> - <checker - class="org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker" - id="org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker" - name="NamingConventionFunctionChecker"> - <problem - category="org.eclipse.cdt.codan.core.categories.CodeStyle" - defaultEnabled="false" - defaultSeverity="Info" - id="org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionProblem" - messagePattern="Bad function name "{0}" (pattern /{1}/)" - name="Name convention for function"> - </problem> - </checker> </extension> </plugin> diff --git a/codan/org.eclipse.cdt.codan.examples/.classpath b/codan/org.eclipse.cdt.codan.examples/.classpath new file mode 100644 index 00000000000..64c5e31b7a2 --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/codan/org.eclipse.cdt.codan.examples/.project b/codan/org.eclipse.cdt.codan.examples/.project new file mode 100644 index 00000000000..7eacfe44864 --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.cdt.codan.examples</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature> + </natures> +</projectDescription> diff --git a/codan/org.eclipse.cdt.codan.examples/.settings/org.eclipse.jdt.core.prefs b/codan/org.eclipse.cdt.codan.examples/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..3d823e3cf64 --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Thu Mar 18 10:08:06 EDT 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/codan/org.eclipse.cdt.codan.examples/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.examples/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..096f9a5604e --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Code Analysis Checker Examples +Bundle-SymbolicName: org.eclipse.cdt.codan.examples;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.cdt.codan.examples.Activator +Bundle-Vendor: CDT +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.cdt.codan.core.cxx;bundle-version="1.0.0", + org.eclipse.cdt.codan.core;bundle-version="1.0.0", + org.eclipse.cdt.core;bundle-version="5.2.0", + org.eclipse.core.resources;bundle-version="3.6.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy diff --git a/codan/org.eclipse.cdt.codan.examples/build.properties b/codan/org.eclipse.cdt.codan.examples/build.properties new file mode 100644 index 00000000000..e9863e281ea --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/codan/org.eclipse.cdt.codan.examples/plugin.xml b/codan/org.eclipse.cdt.codan.examples/plugin.xml new file mode 100644 index 00000000000..8d01e27f26c --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/plugin.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.cdt.codan.core.checkers" + id="org.eclipse.cdt.codan.core.internal.checkers"> + + <checker + class="org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionChecker" + id="org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionChecker" + name="NamingConventionFunctionChecker"> + <problem + category="org.eclipse.cdt.codan.core.categories.CodeStyle" + defaultEnabled="false" + defaultSeverity="Info" + id="org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionProblem" + messagePattern="Bad function name "{0}" (pattern /{1}/)" + name="Name convention for function"> + </problem> + </checker> + </extension> +</plugin> diff --git a/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/Activator.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/Activator.java new file mode 100644 index 00000000000..51f58149f8d --- /dev/null +++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.cdt.codan.examples; + +import org.eclipse.core.runtime.Plugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends Plugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.cdt.codan.examples"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java index 8de54135ead..54799917d94 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/NamingConventionFunctionChecker.java +++ b/codan/org.eclipse.cdt.codan.examples/src/org/eclipse/cdt/codan/examples/checkers/NamingConventionFunctionChecker.java @@ -8,7 +8,7 @@ * Contributors: * Alena Laskavaia - initial API and implementation *******************************************************************************/ -package org.eclipse.cdt.codan.internal.checkers; +package org.eclipse.cdt.codan.examples.checkers; import java.util.regex.Pattern; @@ -30,7 +30,7 @@ public class NamingConventionFunctionChecker extends AbstractCIndexChecker implements ICheckerWithParameters { private static final String DEFAULT_PATTERN = "^[a-z]"; // name starts with english lowercase letter //$NON-NLS-1$ public static final String PARAM_KEY = "pattern"; //$NON-NLS-1$ - private static final String ER_ID = "org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionProblem"; //$NON-NLS-1$ + private static final String ER_ID = "org.eclipse.cdt.codan.examples.checkers.NamingConventionFunctionProblem"; //$NON-NLS-1$ /* * (non-Javadoc) |