tunnel: add javadoc support

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-03-11 00:28:37 -06:00
parent 48739b4141
commit 56f2dcc073
4 changed files with 26 additions and 11 deletions

View File

@ -52,11 +52,25 @@ bintray {
} }
} }
task sourcesJar(type: Jar) { android.libraryVariants.all { variant ->
from android.sourceSets.main.java.srcDirs if (variant.name == 'release') {
archiveClassifier = 'sources' task javadoc(type: Javadoc) {
source = variant.javaCompiler.source
classpath = files((android.bootClasspath.join(File.pathSeparator)))
classpath += variant.javaCompiler.classpath
title = 'Embeddable WireGuard Tunnel for Android v$wireguardVersionName'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs
} }
artifacts { artifacts {
archives sourcesJar archives sourcesJar
archives javadocJar
}
}
} }

View File

@ -33,7 +33,6 @@ public interface Tunnel {
* React to a change in state of the tunnel. Should only be directly called by Backend. * React to a change in state of the tunnel. Should only be directly called by Backend.
* *
* @param newState The new state of the tunnel. * @param newState The new state of the tunnel.
* @return The new state of the tunnel.
*/ */
void onStateChange(State newState); void onStateChange(State newState);

View File

@ -28,7 +28,7 @@ import androidx.annotation.Nullable;
*/ */
@SuppressWarnings({"MagicNumber", "NonConstantFieldWithUpperCaseName", "SuspiciousNameCombination"}) @SuppressWarnings({"MagicNumber", "NonConstantFieldWithUpperCaseName", "SuspiciousNameCombination"})
@NonNullForAll @NonNullForAll
public final class Curve25519 { final class Curve25519 {
// Numbers modulo 2^255 - 19 are broken up into ten 26-bit words. // Numbers modulo 2^255 - 19 are broken up into ten 26-bit words.
private static final int NUM_LIMBS_255BIT = 10; private static final int NUM_LIMBS_255BIT = 10;
private static final int NUM_LIMBS_510BIT = 20; private static final int NUM_LIMBS_510BIT = 20;

View File

@ -5,7 +5,6 @@
package com.wireguard.util; package com.wireguard.util;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
@ -13,12 +12,15 @@ import java.lang.annotation.RetentionPolicy;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierDefault; import javax.annotation.meta.TypeQualifierDefault;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;
/** /**
* This annotation can be applied to a package, class or method to indicate that all * This annotation can be applied to a package, class or method to indicate that all
* class fields and method parameters and return values in that element are nonnull * class fields and method parameters and return values in that element are nonnull
* by default unless overridden. * by default unless overridden.
*/ */
@Documented @RestrictTo(Scope.LIBRARY_GROUP)
@Nonnull @Nonnull
@TypeQualifierDefault({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @TypeQualifierDefault({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)