I am using Emacs (v24.4) for writing Java applications. I have created a Java library that I am building using Gradle (v2.2) and testing with Spock Framework where I have all my test cases.
I would like to debug my Java code using Emacs. However, I haven't found any way of doing this. I would like to set a breakpoint and step through my Java code.
Here is my Gradle build file:
apply plugin: 'java'
apply plugin: 'groovy'
repositories {
mavenCentral()
}
dependencies {
compile 'org.igniterealtime.smack:smack-core:4.1.0'
compile 'org.igniterealtime.smack:smack-tcp:4.1.0'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile 'org.codehaus.groovy:groovy:2.3.6'
}
jar {
baseName = 'SunSmackClient'
version = '1.0.0'
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
Example Spock Framework test:
public class SmackClientSpec extends Specification {
private SmackClient smackClient;
/* Test 1 */
@IgnoreRest
def 'Create a connection to XMPP server'() {
setup: /* Setup connection object */
def domain = 'domain'
def username = 'username'
def password = 'password'
SmackClient smackClient = new SmackClient()
expect: /* Connection to return true */
smackClient.createConnection(domain, username, password) == true
}
}
Many thanks in advance.