-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Java module descriptor configuration
- Loading branch information
1 parent
7fbe829
commit 8bb42e3
Showing
5 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module com.github.pemistahl.lingua { | ||
exports com.github.pemistahl.lingua.api; | ||
|
||
requires kotlin.stdlib; | ||
|
||
requires it.unimi.dsi.fastutil; | ||
requires okio; | ||
|
||
// Moshi accesses JSON serializer using reflection; must open the package | ||
// TODO: Once new Moshi version has module names, change it to `opens ... to com.squareup.moshi` | ||
// and comment in the `requires` declarations below | ||
opens com.github.pemistahl.lingua.internal; | ||
// requires com.squareup.moshi; | ||
// requires com.squareup.moshi.kotlin; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Open complete module for reflection to allow JUnit to access the packages | ||
open module test { | ||
requires com.github.pemistahl.lingua; | ||
|
||
requires org.junit.jupiter.api; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package test; | ||
|
||
import com.github.pemistahl.lingua.api.*; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static com.github.pemistahl.lingua.api.Language.*; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
/** | ||
* Tests basic Lingua functionality. The main purpose of this test is to verify that the | ||
* packages can be accessed from a different module. | ||
*/ | ||
class LinguaTest { | ||
@Test | ||
void test() { | ||
LanguageDetector detector = LanguageDetectorBuilder.fromLanguages(ENGLISH, FRENCH, GERMAN, SPANISH).build(); | ||
Language detectedLanguage = detector.detectLanguageOf("languages are awesome"); | ||
assertEquals(ENGLISH, detectedLanguage); | ||
} | ||
} |