Skip to content

Commit 7ff07ab

Browse files
committed
Update SSLR dependencies and add SSLR Toolkit
1 parent cb59c2a commit 7ff07ab

File tree

7 files changed

+252
-42
lines changed

7 files changed

+252
-42
lines changed

pom.xml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
<modules>
3131
<module>sonar-objective-c-plugin</module>
32+
<module>sslr-objective-c-toolkit</module>
3233
<module>its</module>
3334
</modules>
3435

@@ -96,7 +97,7 @@
9697
<license.owner>${project.organization.name}</license.owner>
9798
<license.mailto>${project.organization.url}</license.mailto>
9899
<sonar.version>4.5.2</sonar.version>
99-
<sslr.version>1.20</sslr.version>
100+
<sslr.version>1.21</sslr.version>
100101
<orchestrator.version>3.10.1</orchestrator.version>
101102
</properties>
102103

@@ -109,24 +110,24 @@
109110
<scope>provided</scope>
110111
</dependency>
111112
<dependency>
112-
<groupId>org.codehaus.sonar.sslr</groupId>
113+
<groupId>org.sonarsource.sslr</groupId>
113114
<artifactId>sslr-core</artifactId>
114115
<version>${sslr.version}</version>
115116
</dependency>
116117
<dependency>
117-
<groupId>org.codehaus.sonar.sslr</groupId>
118+
<groupId>org.sonarsource.sslr</groupId>
118119
<artifactId>sslr-xpath</artifactId>
119120
<version>${sslr.version}</version>
120121
</dependency>
121122
<dependency>
122-
<groupId>org.codehaus.sonar.sslr</groupId>
123+
<groupId>org.sonarsource.sslr</groupId>
123124
<artifactId>sslr-toolkit</artifactId>
124125
<version>${sslr.version}</version>
125126
</dependency>
126127
<dependency>
127-
<groupId>org.codehaus.sonar.sslr-squid-bridge</groupId>
128+
<groupId>org.sonarsource.sslr-squid-bridge</groupId>
128129
<artifactId>sslr-squid-bridge</artifactId>
129-
<version>2.5.3</version>
130+
<version>2.6.1</version>
130131
</dependency>
131132
<dependency>
132133
<groupId>com.googlecode.plist</groupId>
@@ -141,27 +142,15 @@
141142
<scope>test</scope>
142143
</dependency>
143144
<dependency>
144-
<groupId>org.codehaus.sonar.sslr</groupId>
145+
<groupId>org.sonarsource.sslr</groupId>
145146
<artifactId>sslr-testing-harness</artifactId>
146147
<version>${sslr.version}</version>
147148
<scope>test</scope>
148149
</dependency>
149150
<dependency>
150151
<groupId>junit</groupId>
151152
<artifactId>junit</artifactId>
152-
<version>4.10</version>
153-
<scope>test</scope>
154-
</dependency>
155-
<dependency>
156-
<groupId>org.mockito</groupId>
157-
<artifactId>mockito-all</artifactId>
158-
<version>1.9.0</version>
159-
<scope>test</scope>
160-
</dependency>
161-
<dependency>
162-
<groupId>org.hamcrest</groupId>
163-
<artifactId>hamcrest-all</artifactId>
164-
<version>1.1</version>
153+
<version>4.12</version>
165154
<scope>test</scope>
166155
</dependency>
167156
<dependency>

sonar-objective-c-plugin/pom.xml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,11 @@
3030
<scope>provided</scope>
3131
</dependency>
3232
<dependency>
33-
<groupId>org.codehaus.sonar.sslr</groupId>
33+
<groupId>org.sonarsource.sslr</groupId>
3434
<artifactId>sslr-core</artifactId>
3535
</dependency>
3636
<dependency>
37-
<groupId>org.codehaus.sonar.sslr</groupId>
38-
<artifactId>sslr-xpath</artifactId>
39-
</dependency>
40-
<dependency>
41-
<groupId>org.codehaus.sonar.sslr</groupId>
42-
<artifactId>sslr-toolkit</artifactId>
43-
</dependency>
44-
<dependency>
45-
<groupId>org.codehaus.sonar.sslr-squid-bridge</groupId>
37+
<groupId>org.sonarsource.sslr-squid-bridge</groupId>
4638
<artifactId>sslr-squid-bridge</artifactId>
4739
</dependency>
4840
<dependency>
@@ -56,7 +48,7 @@
5648
<scope>test</scope>
5749
</dependency>
5850
<dependency>
59-
<groupId>org.codehaus.sonar.sslr</groupId>
51+
<groupId>org.sonarsource.sslr</groupId>
6052
<artifactId>sslr-testing-harness</artifactId>
6153
<scope>test</scope>
6254
</dependency>
@@ -65,16 +57,6 @@
6557
<artifactId>junit</artifactId>
6658
<scope>test</scope>
6759
</dependency>
68-
<dependency>
69-
<groupId>org.mockito</groupId>
70-
<artifactId>mockito-all</artifactId>
71-
<scope>test</scope>
72-
</dependency>
73-
<dependency>
74-
<groupId>org.hamcrest</groupId>
75-
<artifactId>hamcrest-all</artifactId>
76-
<scope>test</scope>
77-
</dependency>
7860
<dependency>
7961
<groupId>org.easytesting</groupId>
8062
<artifactId>fest-assert</artifactId>

sonar-objective-c-plugin/src/main/java/org/sonar/objectivec/ObjectiveCConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
package org.sonar.objectivec;
2121

22-
import org.sonar.squid.api.SquidConfiguration;
22+
import org.sonar.squidbridge.api.SquidConfiguration;
2323

2424
import java.nio.charset.Charset;
2525

sslr-objective-c-toolkit/pom.xml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.sonarqubecommunity.objectivec</groupId>
7+
<artifactId>objective-c</artifactId>
8+
<version>0.5.0-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>sslr-objective-c-toolkit</artifactId>
12+
13+
<name>SonarQube Objective-C (Community) :: SSLR Toolkit</name>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.codehaus.sonar</groupId>
18+
<artifactId>sonar-plugin-api</artifactId>
19+
<scope>provided</scope>
20+
</dependency>
21+
<dependency>
22+
<groupId>${project.groupId}</groupId>
23+
<artifactId>sonar-objective-c-plugin</artifactId>
24+
<version>${project.version}</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.sonarsource.sslr</groupId>
28+
<artifactId>sslr-toolkit</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>ch.qos.logback</groupId>
32+
<artifactId>logback-classic</artifactId>
33+
</dependency>
34+
<dependency>
35+
<groupId>junit</groupId>
36+
<artifactId>junit</artifactId>
37+
<scope>test</scope>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.easytesting</groupId>
41+
<artifactId>fest-assert</artifactId>
42+
<scope>test</scope>
43+
</dependency>
44+
</dependencies>
45+
46+
<build>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-jar-plugin</artifactId>
51+
<configuration>
52+
<archive>
53+
<manifest>
54+
<mainClass>org.sonar.objectivec.toolkit.ObjectiveCToolkit</mainClass>
55+
</manifest>
56+
</archive>
57+
</configuration>
58+
</plugin>
59+
<plugin>
60+
<groupId>org.sonatype.plugins</groupId>
61+
<artifactId>jarjar-maven-plugin</artifactId>
62+
<executions>
63+
<execution>
64+
<phase>package</phase>
65+
<goals>
66+
<goal>jarjar</goal>
67+
</goals>
68+
<configuration>
69+
<includes>
70+
<include>${project.groupId}:sonar-objective-c-plugin</include>
71+
<include>org.sonarsource.sslr:sslr-core</include>
72+
<include>org.sonarsource.sslr:sslr-xpath</include>
73+
<include>jaxen:jaxen</include>
74+
<include>org.sonarsource.sslr:sslr-toolkit</include>
75+
<include>org.sonarsource.sslr-squid-bridge:sslr-squid-bridge</include>
76+
<include>org.codehaus.sonar:sonar-colorizer</include>
77+
<include>org.codehaus.sonar:sonar-channel</include>
78+
<include>org.slf4j:slf4j-api</include>
79+
<include>org.slf4j:jcl-over-slf4j</include>
80+
<include>ch.qos.logback:logback-classic</include>
81+
<include>ch.qos.logback:logback-core</include>
82+
<include>commons-io:commons-io</include>
83+
<include>commons-lang:commons-lang</include>
84+
<include>com.google.guava:guava</include>
85+
</includes>
86+
<rules>
87+
<keep>
88+
<pattern>*.**</pattern>
89+
</keep>
90+
</rules>
91+
</configuration>
92+
</execution>
93+
</executions>
94+
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-enforcer-plugin</artifactId>
98+
<executions>
99+
<execution>
100+
<id>enforce-size</id>
101+
<goals>
102+
<goal>enforce</goal>
103+
</goals>
104+
<phase>verify</phase>
105+
<configuration>
106+
<rules>
107+
<requireFilesSize>
108+
<maxsize>4700000</maxsize>
109+
<minsize>4600000</minsize>
110+
<files>
111+
<file>${project.build.directory}/${project.build.finalName}.jar</file>
112+
</files>
113+
</requireFilesSize>
114+
</rules>
115+
</configuration>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
</plugins>
120+
</build>
121+
</project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* SonarQube Objective-C (Community) :: SSLR Toolkit
3+
* Copyright (C) 2012-2016 OCTO Technology, Backelite, and contributors
4+
* mailto:sonarqube@googlegroups.com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but 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 License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
package org.sonar.objectivec.toolkit;
21+
22+
import com.google.common.base.Charsets;
23+
import com.sonar.sslr.impl.Parser;
24+
import org.sonar.colorizer.Tokenizer;
25+
import org.sonar.objectivec.ObjectiveCConfiguration;
26+
import org.sonar.objectivec.parser.ObjectiveCParser;
27+
import org.sonar.sslr.toolkit.AbstractConfigurationModel;
28+
import org.sonar.sslr.toolkit.ConfigurationProperty;
29+
30+
import java.util.Collections;
31+
import java.util.List;
32+
33+
public class ObjectiveCConfigurationModel extends AbstractConfigurationModel {
34+
@Override
35+
public List<ConfigurationProperty> getProperties() {
36+
return Collections.emptyList();
37+
}
38+
39+
@Override
40+
public Parser doGetParser() {
41+
return ObjectiveCParser.create(new ObjectiveCConfiguration(Charsets.UTF_8));
42+
}
43+
44+
@Override
45+
public List<Tokenizer> doGetTokenizers() {
46+
return Collections.emptyList();
47+
}
48+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* SonarQube Objective-C (Community) :: SSLR Toolkit
3+
* Copyright (C) 2012-2016 OCTO Technology, Backelite, and contributors
4+
* mailto:sonarqube@googlegroups.com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but 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 License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
package org.sonar.objectivec.toolkit;
21+
22+
import org.sonar.sslr.toolkit.Toolkit;
23+
24+
public final class ObjectiveCToolkit {
25+
private ObjectiveCToolkit() {
26+
// Prevents outside instantiation
27+
}
28+
29+
public static void main(String[] args) {
30+
Toolkit toolkit = new Toolkit("SSLR :: Objective-C (Community) :: Toolkit", new ObjectiveCConfigurationModel());
31+
toolkit.run();
32+
}
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* SonarQube Objective-C (Community) :: SSLR Toolkit
3+
* Copyright (C) 2012-2016 OCTO Technology, Backelite, and contributors
4+
* mailto:sonarqube@googlegroups.com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but 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 License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
package org.sonar.objectivec.toolkit;
21+
22+
import org.junit.Test;
23+
24+
import static org.fest.assertions.Assertions.assertThat;
25+
26+
public class ObjectiveCConfigurationModelTest {
27+
@Test
28+
public void getProperties() {
29+
ObjectiveCConfigurationModel model = new ObjectiveCConfigurationModel();
30+
assertThat(model.getProperties()).isEmpty();
31+
}
32+
33+
@Test
34+
public void getTokenizers() {
35+
assertThat(new ObjectiveCConfigurationModel().getTokenizers()).isEmpty();
36+
}
37+
}

0 commit comments

Comments
 (0)