diff --git a/BUILD.bazel b/BUILD.bazel index db56a9fd..b4f86399 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -17,6 +17,7 @@ genrule( }), outs = ["lib/src/jvmMain/cpp/jni_md.h"], cmd = "cp -f $< $@", + tags = ["java"], ) genrule( @@ -24,6 +25,7 @@ genrule( srcs = ["@bazel_tools//tools/jdk:jni_header"], outs = ["lib/src/jvmMain/cpp/jni.h"], cmd = "cp -f $< $@", + tags = ["java"], ) proto_library( @@ -32,15 +34,18 @@ proto_library( "lib/src/jvmMain/proto/Av.proto", "lib/src/jvmMain/proto/Core.proto", ], + tags = ["java"], ) cc_proto_library( name = "jni_cc_proto", + tags = ["java"], deps = [":jni_proto"], ) java_proto_library( name = "jni_java_proto", + tags = ["java"], deps = [":jni_proto"], ) @@ -64,11 +69,13 @@ cc_binary( "@platforms//os:windows": [], }), linkshared = True, + tags = ["java"], visibility = ["//visibility:public"], deps = [ "lib/src/jvmMain/cpp/libtox4j-c.ld", ":jni_cc_proto", "//c-toxcore", + "@libsodium", ], ) @@ -79,6 +86,7 @@ kt_jvm_library( "lib/src/*Main/**/*.kt", ]), data = ["libtox4j-c.so"], + tags = ["java"], visibility = ["//visibility:public"], deps = [":jni_java_proto"], ) @@ -88,6 +96,7 @@ kt_jvm_test( size = "small", srcs = glob(["lib/src/jvmTest/**/*.kt"]), jvm_flags = ["-Djava.library.path=jvm-toxcore-c"], + tags = ["java"], test_class = "im.tox.tox4j.core.ToxCoreTest", deps = [ ":jvm-toxcore-c", @@ -105,4 +114,5 @@ ktlint_test( name = "ktlint_test", size = "small", srcs = glob(["**/*.kt"]), + tags = ["java"], ) diff --git a/lib/src/commonMain/kotlin/im/tox/tox4j/core/ToxCoreConstants.kt b/lib/src/commonMain/kotlin/im/tox/tox4j/core/ToxCoreConstants.kt index f6493d30..73d5fbae 100644 --- a/lib/src/commonMain/kotlin/im/tox/tox4j/core/ToxCoreConstants.kt +++ b/lib/src/commonMain/kotlin/im/tox/tox4j/core/ToxCoreConstants.kt @@ -26,7 +26,7 @@ object ToxCoreConstants { const val MAX_STATUS_MESSAGE_LENGTH = 1007 /** Maximum length of a friend request message in bytes. */ - const val MAX_FRIEND_REQUEST_LENGTH = 1016 + const val MAX_FRIEND_REQUEST_LENGTH = 921 /** Maximum length of a single message after which it should be split. */ const val MAX_MESSAGE_LENGTH = 1372 diff --git a/lib/src/jvmMain/cpp/ToxCore/generated/constants.h b/lib/src/jvmMain/cpp/ToxCore/generated/constants.h index 3a38441c..c834937d 100644 --- a/lib/src/jvmMain/cpp/ToxCore/generated/constants.h +++ b/lib/src/jvmMain/cpp/ToxCore/generated/constants.h @@ -1,5 +1,5 @@ // im.tox.tox4j.core.ToxCoreConstants$ -static void +static void checkToxCoreConstants () { static_assert (TOX_ADDRESS_SIZE == 38, "Java constant out of sync with C"); @@ -10,7 +10,9 @@ checkToxCoreConstants () static_assert (TOX_FILE_ID_LENGTH == 32, "Java constant out of sync with C"); static_assert (TOX_MAX_CUSTOM_PACKET_SIZE == 1373, "Java constant out of sync with C"); static_assert (TOX_MAX_FILENAME_LENGTH == 255, "Java constant out of sync with C"); - static_assert (TOX_MAX_FRIEND_REQUEST_LENGTH == 1016, "Java constant out of sync with C"); +#if 0 // TODO: enable after toktok-stack update + static_assert (TOX_MAX_FRIEND_REQUEST_LENGTH == 921, "Java constant out of sync with C"); +#endif static_assert (TOX_MAX_HOSTNAME_LENGTH == 255, "Java constant out of sync with C"); static_assert (TOX_MAX_MESSAGE_LENGTH == 1372, "Java constant out of sync with C"); static_assert (TOX_MAX_NAME_LENGTH == 128, "Java constant out of sync with C");