1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Add a REPL for Smack (smack-repl)

This commit is contained in:
Florian Schmaus 2016-02-10 14:09:13 +01:00
parent 529e1eb058
commit 8f149346a6
6 changed files with 111 additions and 1 deletions

18
smack-repl/build.gradle Normal file
View file

@ -0,0 +1,18 @@
ext {
scalaVersion = '2.11.7'
}
dependencies {
compile project(':smack-tcp')
compile project(':smack-bosh')
compile project(':smack-java7')
compile project(':smack-resolver-minidns')
compile project(':smack-extensions')
compile project(':smack-experimental')
compile project(':smack-legacy')
compile "org.scala-lang:scala-compiler:${scalaVersion}"
}
task printClasspath(dependsOn: assemble) << {
println sourceSets.main.runtimeClasspath.asPath
}

6
smack-repl/scala.repl Normal file
View file

@ -0,0 +1,6 @@
org.igniterealtime.smack.repl.SmackRepl.init()
import org.jivesoftware.smack._
import org.jivesoftware.smack.util.TLSUtils
import org.jivesoftware.smack.tcp._
import org.jxmpp.jid.impl.JidCreate

View file

@ -0,0 +1,34 @@
/**
*
* Copyright 2016 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.igniterealtime.smack.repl;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.util.dns.javax.JavaxResolver;
public class SmackRepl {
public static void init() {
SmackConfiguration.getVersion();
// smack-repl also pulls in smack-resolver-minidns which has higher precedence the smack-resolver-javax but
// won't work on Java SE platforms. Therefore explicitly setup JavaxResolver.
JavaxResolver.setup();
// CHECKSTYLE:OFF
System.out.println("Smack REPL");
// CHECKSTYLE:ON
}
}

View file

@ -0,0 +1,21 @@
/**
*
* Copyright 2016 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* A REPL (Read Eval Print Loop) for Smack.
*/
package org.igniterealtime.smack.repl;