Skip to content

Commit 70278c6

Browse files
author
breandan
committed
Update Gradle build process.
1 parent 525b527 commit 70278c6

7 files changed

Lines changed: 571 additions & 801 deletions

File tree

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.idea/shelf
1313
.idea/tasks.xml
1414
.idea/dictionaries
15+
.idea/libraries/Gradle*.xml
1516

1617
# Sensitive or high-churn files:
1718
# .idea/dataSources.ids
@@ -35,11 +36,10 @@ idear.zip
3536
### Gradle template
3637
.gradle
3738
build/
39+
gradle.properties
3840

3941
# Ignore Gradle GUI config
4042
gradle-app.setting
4143

4244
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
43-
!gradle-wrapper.jar
44-
45-
45+
!gradle-wrapper.jar

.idea/workspace.xml

Lines changed: 441 additions & 794 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ intellij {
2525
version '15.0.1'
2626
plugins 'coverage'
2727
pluginName 'idear'
28+
29+
publish {
30+
pluginId '7910'
31+
apply from: "gradle.properties"
32+
}
2833
}
2934

3035
group 'com.jetbrains'
31-
version '0.0.1-SNAPSHOT'
36+
version '1.2'
3237

3338
repositories {
3439
mavenCentral()

idear.iml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:0.1-SNAPSHOT" level="project" />
2020
<orderEntry type="library" name="Gradle: edu.cmu.sphinx:sphinx4-core:5prealpha-SNAPSHOT" level="project" />
2121
<orderEntry type="library" name="Gradle: org.apache.opennlp:opennlp-tools:1.6.0" level="project" />
22+
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
2223
<orderEntry type="library" name="Gradle: com.mashape.unirest:unirest-java:1.4.7" level="project" />
2324
<orderEntry type="library" name="Gradle: de.dfki.mary:marytts-runtime:5.2-SNAPSHOT" level="project" />
2425
<orderEntry type="library" name="Gradle: de.dfki.mary:marytts-lang-en:5.2-SNAPSHOT" level="project" />
2526
<orderEntry type="library" name="Gradle: de.dfki.mary:voice-cmu-slt-hsmm:5.2-SNAPSHOT" level="project" />
26-
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.3.3" level="project" />
2727
<orderEntry type="library" name="Gradle: org.codehaus.jettison:jettison:1.3.7" level="project" />
28+
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
2829
<orderEntry type="library" name="Gradle: com.jetbrains:annotations:15.0.1" level="project" />
2930
<orderEntry type="library" name="Gradle: com.jetbrains:asm-all:15.0.1" level="project" />
3031
<orderEntry type="library" name="Gradle: com.jetbrains:asm-commons:15.0.1" level="project" />
@@ -134,7 +135,6 @@
134135
<orderEntry type="library" name="Gradle: com.jetbrains:jacocoagent:15.0.1" level="project" />
135136
<orderEntry type="library" name="Gradle: com.jetbrains:jacocoant:15.0.1" level="project" />
136137
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-runtime:0.1-SNAPSHOT" level="project" />
137-
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore-nio:4.3.2" level="project" />
138138
<orderEntry type="library" name="Gradle: org.apache.commons:commons-math3:3.2" level="project" />
139139
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.3.6" level="project" />
140140
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpasyncclient:4.0.2" level="project" />

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<version>1.2</version>
55
<vendor email="breandan.considine@jetbrains.com" url="http://www.jetbrains.com">JetBrains</vendor>
66

7-
<description><![CDATA[Speech recognition for IntelliJ IDEA. Idear listens to voice commands and assists with simple actions like debugging, navigation, and refactoring. For a complete list of commands, please see the <a href="https://github.com/breandan/idear/blob/master/src/resources/com.jetbrains.idear/grammars/command.gram">command grammar</a>.]]></description>
7+
<description><![CDATA[Speech recognition for IntelliJ IDEA. Idear listens to voice commands and assists with simple actions like debugging, navigation, and refactoring. For a complete list of commands, please see the <a href="https://github.com/breandan/idear/blob/master/src/main/resources/com.jetbrains.idear/grammars/command.gram">command grammar</a>.]]></description>
88
<change-notes><![CDATA[Introduces debugging and AceJump navigation.]]>
99
</change-notes>
1010

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.jetbrains.idear;
2+
3+
import com.intellij.openapi.actionSystem.DataContext;
4+
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
5+
import com.jetbrains.idear.actions.recognition.ActionCallInfo;
6+
import com.jetbrains.idear.actions.recognition.ExtractActionRecognizer;
7+
import org.junit.Test;
8+
9+
import static org.junit.Assert.assertEquals;
10+
import static org.junit.Assert.assertTrue;
11+
12+
public class ActionRecognizerTest {
13+
14+
@Test
15+
public void test_extract_with_name() throws Exception {
16+
String text = "idea extract to variable myTest";
17+
18+
ExtractActionRecognizer recognizer = new ExtractActionRecognizer();
19+
assertTrue(recognizer.isMatching(text));
20+
21+
ActionCallInfo info = recognizer.getActionInfo(text, getEmptyDataContext());
22+
assertEquals("IntroduceVariable", info.getActionId());
23+
assertEquals("myTest", info.getTypeAfter());
24+
}
25+
26+
@Test
27+
public void test_extract_without_name() throws Exception {
28+
String text = "idea extract to variable";
29+
ExtractActionRecognizer recognizer = new ExtractActionRecognizer();
30+
assertTrue(recognizer.isMatching(text));
31+
32+
ActionCallInfo info = recognizer.getActionInfo(text, getEmptyDataContext());
33+
assertEquals("IntroduceVariable", info.getActionId());
34+
}
35+
36+
private static DataContext getEmptyDataContext() {
37+
return SimpleDataContext.getSimpleContext("", null);
38+
}
39+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package com.jetbrains.idear;
2+
3+
import com.jetbrains.idear.nlp.NlpParserService;
4+
import opennlp.tools.parser.Parse;
5+
import org.junit.BeforeClass;
6+
import org.junit.Test;
7+
8+
import java.io.IOException;
9+
10+
import static org.junit.Assert.assertEquals;
11+
import static org.junit.Assert.assertNotNull;
12+
13+
public class NlpParserTest {
14+
private static NlpParserService myParser;
15+
16+
@BeforeClass
17+
public static void setUp() throws Exception {
18+
myParser = new NlpParserService("en-parser-chunking.bin");
19+
myParser.init();
20+
}
21+
22+
@Test
23+
public void testExtractFind_Class() throws Exception {
24+
doTestExtractAction("Idea find usage of class action", "find");
25+
}
26+
27+
@Test
28+
public void testExtractFind_Method() throws Exception {
29+
doTestExtractAction("Idea find usage of method run", "find");
30+
}
31+
32+
@Test
33+
public void testExtractGoTo_Class() throws Exception {
34+
doTestExtractAction("Idea go to class CodeStyleSettings", "go");
35+
}
36+
37+
@Test
38+
public void testExtractGoTo_Method() throws Exception {
39+
doTestExtractAction("Idea go to method apply", "go");
40+
}
41+
42+
@Test
43+
public void testExtractExtract_Variable() throws Exception {
44+
doTestExtractAction("Idea extract to variable x", "extract");
45+
}
46+
47+
@Test
48+
public void testExtractExtract_Variable_WithoutName() throws Exception {
49+
doTestExtractAction("Idea extract to variable", "extract");
50+
}
51+
52+
@Test
53+
public void testExtractExtract_Field_WithoutName() throws Exception {
54+
doTestExtractAction("Idea extract to field", "extract");
55+
}
56+
57+
@Test
58+
public void testExtractExtract_Field() throws Exception {
59+
doTestExtractAction("Idea extract to field x", "extract");
60+
}
61+
62+
@Test
63+
public void testExtractIntroduce_Field() throws Exception {
64+
doTestExtractAction("Idea introduce field", "introduce");
65+
}
66+
67+
@Test
68+
public void testInline_Field() throws Exception {
69+
doTestExtractAction("Idea inline", "inline");
70+
}
71+
72+
private void doTestExtractAction(String sentence, String action) throws IOException {
73+
Parse root = myParser.parseSentence(sentence);
74+
assertNotNull(root);
75+
Parse head = root.getChildren()[0].getHead();
76+
assertEquals(head.getCoveredText(), action);
77+
}
78+
79+
}

0 commit comments

Comments
 (0)