Skip to content

Commit 9d833cf

Browse files
committed
Add packaging options
1 parent 9ca2bf3 commit 9d833cf

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Commons extension (name not final)
2+
==================================
3+
4+
This is a skeleton of OpenRefine extension for Wikimedia Commons, in the form of an independent Maven project.
5+
It works with OpenRefine 3.6+.
6+
7+
8+
Building it
9+
-----------
10+
11+
Run
12+
```
13+
mvn package
14+
```
15+
16+
This creates a zip file in the `target` folder, which can then be [installed in OpenRefine](https://docs.openrefine.org/manual/installing#installing-extensions).
17+
18+
Developing it
19+
-------------
20+
21+
To avoid having to unzip the extension in the corresponding directory every time you want to test it, you can also use another set up: simply create a symbolic link from your extensions folder in OpenRefine to the local copy of this repository.
22+
You will still need to restart OpenRefine every time you make changes.

module/MOD-INF/controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
* Function invoked to initialize the extension.
44
*/
55
function init() {
6+
7+
// Register our GREL functions so that they are visible in OpenRefine
8+
var CFR = Packages.com.google.refine.grel.ControlFunctionRegistry;
69

10+
CFR.registerFunction("extractCategories", new Packages.org.openrefine.extensions.commons.functions.ExtractCategories());
711
}

pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@
8181
</filesets>
8282
</configuration>
8383
</plugin>
84+
<plugin>
85+
<artifactId>maven-assembly-plugin</artifactId>
86+
<version>3.0.0</version>
87+
<configuration>
88+
<appendAssemblyId>false</appendAssemblyId>
89+
<descriptors>
90+
<descriptor>src/assembly/extension.xml</descriptor>
91+
</descriptors>
92+
</configuration>
93+
<executions>
94+
<execution>
95+
<id>make-assembly</id>
96+
<phase>package</phase>
97+
<goals>
98+
<goal>single</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
84103
</plugins>
85104
</build>
86105

@@ -101,16 +120,19 @@
101120
<groupId>com.fasterxml.jackson.core</groupId>
102121
<artifactId>jackson-core</artifactId>
103122
<version>${jackson.version}</version>
123+
<scope>provided</scope>
104124
</dependency>
105125
<dependency>
106126
<groupId>org.openrefine.dependencies.wdtk</groupId>
107127
<artifactId>wdtk-datamodel</artifactId>
108128
<version>${wdtk.version}</version>
129+
<scope>provided</scope>
109130
</dependency>
110131
<dependency>
111132
<groupId>org.openrefine.dependencies.wdtk</groupId>
112133
<artifactId>wdtk-util</artifactId>
113134
<version>${wdtk.version}</version>
135+
<scope>provided</scope>
114136
</dependency>
115137
<dependency>
116138
<groupId>org.slf4j</groupId>

src/assembly/extension.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
4+
<id>openrefine-commons-${openrefine.version}</id>
5+
<includeBaseDirectory>false</includeBaseDirectory>
6+
<formats>
7+
<format>zip</format>
8+
</formats>
9+
<fileSets>
10+
<fileSet>
11+
<directory>module/</directory>
12+
<outputDirectory>module/</outputDirectory>
13+
<excludes>
14+
<exclude>**/*.java</exclude>
15+
</excludes>
16+
</fileSet>
17+
<fileSet>
18+
<directory>src/main/resources/module</directory>
19+
<outputDirectory>module</outputDirectory>
20+
</fileSet>
21+
</fileSets>
22+
</assembly>

src/test/conf/tests.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
2+
3+
<suite name="Commons extension">
4+
<test name="tests">
5+
<groups>
6+
<run>
7+
<exclude name="broken" />
8+
</run>
9+
</groups>
10+
<packages>
11+
<package name="org.openrefine.extensions.commons.*" />
12+
</packages>
13+
</test>
14+
</suite>

0 commit comments

Comments
 (0)