Commits

Anonymous committed 94700ad

moving the repository to BB

Comments (0)

Files changed (7)

+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>com.atlassian.tutorials.fecru</groupId>
+    <artifactId>gutter</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <organization>
+        <name>Example Company</name>
+        <url>http://www.example.com/</url>
+    </organization>
+
+    <name>gutter</name>
+    <description>This is the com.atlassian.tutorials.fecru:gutter plugin for Atlassian FishEye/Crucible.</description>
+    <packaging>atlassian-plugin</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.4</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.atlassian.fisheye</groupId>
+            <artifactId>atlassian-fisheye-api</artifactId>
+            <version>${fecru.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.atlassian.crucible</groupId>
+            <artifactId>atlassian-crucible-scmutils</artifactId>
+            <version>${fecru.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.atlassian.maven.plugins</groupId>
+                <artifactId>maven-fecru-plugin</artifactId>
+                <version>3.0-SNAPSHOT</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <productVersion>${fecru.version}</productVersion>
+                    <productDataVersion>${fecru.data.version}</productDataVersion>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <properties>
+        <fecru.version>2.1.0.M3-tom3</fecru.version>
+        <fecru.data.version>2.0.4.1-SNAPSHOT</fecru.data.version>
+    </properties>
+
+</project>

src/main/java/com/atlassian/tutorials/fecru/gutter/ExampleServlet.java

+package com.atlassian.tutorials.fecru.gutter;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+public class ExampleServlet extends HttpServlet {
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        //TODO show example of using Crucible API
+        response.getWriter().print("Hello from a servlet plugin");
+    }
+}

src/main/java/com/atlassian/tutorials/fecru/gutter/TutorialDiffLineDecorator.java

+package com.atlassian.tutorials.fecru.gutter;
+
+import com.atlassian.fisheye.ui.filedecoration.DiffLineDecorator;
+import com.atlassian.fisheye.ui.filedecoration.GutterRenderResult;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: tomd
+ * Date: 03-Oct-2009
+ * Time: 23:32:46
+ * To change this template use File | Settings | File Templates.
+ */
+public class TutorialDiffLineDecorator implements DiffLineDecorator {
+    public GutterRenderResult decorateLineCommon(int i, int i1) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public GutterRenderResult decorateLineAdded(int i) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public GutterRenderResult decorateLineRemoved(int i) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public GutterRenderResult decorateLineChanged(int i, int i1) {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

src/main/java/com/atlassian/tutorials/fecru/gutter/TutorialGutterRenderer.java

+package com.atlassian.tutorials.fecru.gutter;
+
+import com.atlassian.fisheye.ui.filedecoration.DiffLineDecorator;
+import com.atlassian.fisheye.ui.filedecoration.DiffType;
+import com.atlassian.fisheye.ui.filedecoration.GutterRenderer;
+import com.atlassian.fisheye.ui.filedecoration.LineDecorator;
+
+import java.util.Collections;
+import java.util.List;
+
+public class TutorialGutterRenderer implements GutterRenderer {
+
+    public List<LineDecorator> getAnnotationDecorators(String repository, String path, String rev) {
+        String fileName = path.substring(path.lastIndexOf('/')+1);
+        if (fileName.matches(".*[aA].*")) {
+            return Collections.<LineDecorator>singletonList(new TutorialLineDecorator(fileName.length()));
+        } else {
+            return Collections.emptyList();            
+        }
+    }
+
+    public List<DiffLineDecorator> getAnnotationDecorators(DiffType diffType, String repository, String fromPath, String fromRev, String toPath, String toRev) {
+        return Collections.emptyList();
+    }
+}

src/main/java/com/atlassian/tutorials/fecru/gutter/TutorialLineDecorator.java

+package com.atlassian.tutorials.fecru.gutter;
+
+import com.atlassian.fisheye.ui.filedecoration.GutterRenderResult;
+import com.atlassian.fisheye.ui.filedecoration.LineDecorator;
+
+import java.util.List;
+
+
+public class TutorialLineDecorator implements LineDecorator {
+    private final int lineToDecorate;
+
+    public TutorialLineDecorator(int lineToDecorate) {
+        this.lineToDecorate = lineToDecorate;
+    }
+
+    public GutterRenderResult decorateLine(int i) {
+        GutterRenderResult r = new GutterRenderResult();
+        if (i == lineToDecorate) {
+            r.setInnerHtml("Decoration!");            
+        }
+        return r;
+    }
+}

src/main/resources/atlassian-plugin.xml

+<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.artifactId}" plugins-version="2">
+    <plugin-info>
+        <description>${project.description}</description>
+        <version>${project.version}</version>
+        <vendor name="${project.organization.name}" url="${project.organization.url}" />
+    </plugin-info>
+
+    <gutter-renderer key="my-gutter-renderer" class="com.atlassian.tutorials.fecru.gutter.TutorialGutterRenderer"/>
+</atlassian-plugin>

src/test/resources/TEST_RESOURCES_README.txt

+Create any of the test resources you might need in this directory.
+
+Please remove this file before releasing your plugin.
+