apply plugin: 'java'
-sourceCompatibility = 1.7
-targetCompatibility = 1.7
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
provided group: 'org.freenetproject', name: 'freenet-ext', version: '29'
provided group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
- compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib'
+ compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
compile group: 'net.pterodactylus', name: 'utils', version: '0.12.4'
compile group: 'com.google.inject', name: 'guice', version: '4.2.2'
compile group: 'com.google.guava', name: 'guava', version: '27.0.1-android'
bind(Context::class.java).toInstance(context)
bind(object : TypeLiteral<Optional<Context>>() {}).toInstance(Optional.of(context))
bind(SonePlugin::class.java).toInstance(sonePlugin)
- bind(Version::class.java).toInstance(sonePlugin.version.parseVersion())
+ bind(Version::class.java).toInstance(sonePlugin.version.drop(1).parseVersion())
bind(PluginVersion::class.java).toInstance(PluginVersion(sonePlugin.version))
bind(PluginYear::class.java).toInstance(PluginYear(sonePlugin.year))
bind(PluginHomepage::class.java).toInstance(PluginHomepage(sonePlugin.homepage))
import java.io.*
import java.util.concurrent.atomic.*
+const val versionString = "v80"
+
class SoneModuleTest {
private val currentDir: File = File(".")
- private val pluginVersion = Version("", 0, 1, 2)
+ private val pluginVersion = Version("", 80)
private val pluginYear = 2019
private val pluginHomepage = "home://page"
private val sonePlugin = mock<SonePlugin>().apply {
- whenever(version).thenReturn(pluginVersion.toString())
+ whenever(version).thenReturn(versionString)
whenever(year).thenReturn(pluginYear)
whenever(homepage).thenReturn(pluginHomepage)
}
@Test
fun `plugin version is bound`() {
- assertThat(injector.getInstance(), equalTo(PluginVersion(pluginVersion.toString())))
+ assertThat(injector.getInstance(), equalTo(PluginVersion(versionString)))
}
@Test