# Baseline Java code quality plugins
[![CircleCI Build Status](https://circleci.com/gh/palantir/gradle-baseline/tree/develop.svg?style=shield)](https://circleci.com/gh/palantir/gradle-baseline)
[![Gradle Plugin Portal](https://img.shields.io/maven-metadata/v/https/plugins.gradle.org/m2/com/palantir/baseline/com.palantir.baseline.gradle.plugin/maven-metadata.xml.svg?label=plugin&logo=gradle)](https://plugins.gradle.org/plugin/com.palantir.baseline)

_Baseline is a family of Gradle plugins for configuring Java projects with sensible defaults for code-style, static analysis, dependency versioning, CircleCI and IntelliJ IDEA/Eclipse integration._

| Plugin                                         | Description            |
|------------------------------------------------|------------------------|
| `com.palantir.baseline-idea`                   | Configures [Intellij IDEA](https://www.jetbrains.com/idea/) with code style and copyright headers
| `com.palantir.baseline-eclipse`                | Configures [Eclipse](https://www.eclipse.org/downloads/) with code style and copyright headers
| `com.palantir.baseline-error-prone`            | Static analysis for your Java code using Google's [error-prone](http://errorprone.info/).
| `com.palantir.baseline-checkstyle`             | Enforces consistent Java formatting using [checkstyle](http://checkstyle.sourceforge.io/)
| `com.palantir.baseline-format`                 | Formats your java files to comply with checkstyle
| `com.palantir.baseline-scalastyle`             | Enforces formatting using [scalastyle](https://github.com/scalastyle/scalastyle)
| `com.palantir.baseline-class-uniqueness`       | Analyses your classpath to ensure no fully-qualified class is defined more than once.
| `com.palantir.baseline-circleci`               | [CircleCI](https://circleci.com/) integration using `$CIRCLE_ARTIFACTS` and `$CIRCLE_TEST_REPORTS` dirs
| `com.palantir.baseline-config`                 | Config files for the above plugins
| `com.palantir.baseline-reproducibility`        | Sensible defaults to ensure Jar, Tar and Zip tasks can be reproduced
| `com.palantir.baseline-exact-dependencies`     | Ensures projects explicitly declare all the dependencies they rely on, no more and no less
| `com.palantir.baseline-encoding`               | Ensures projects use the UTF-8 encoding in compile tasks.
| `com.palantir.baseline-release-compatibility`  | Ensures projects targeting older JREs only compile against classes and methods available in those JREs.
| `com.palantir.baseline-testing`                | Configures test tasks to dump heap dumps (hprof files) for convenient debugging
| `com.palantir.baseline-immutables`             | Enables incremental compilation for the [Immutables](http://immutables.github.io/) annotation processor.
| `com.palantir.baseline-java-versions`          | Configures JDK versions in a consistent way via Gradle Toolchains.
| `com.palantir.baseline-prefer-project-modules` | Configures Gradle to prefer project modules over external modules on dependency resolution per default.

See also the [Baseline Java Style Guide and Best Practices](./docs).

## Usage
The baseline set of plugins requires at least Gradle 6.1.

It is recommended to add `apply plugin: 'com.palantir.baseline'` to your root project's build.gradle.  Individual plugins will be automatically applied to appropriate subprojects.

```Gradle
buildscript {
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }

    dependencies {
        classpath 'com.palantir.baseline:gradle-baseline-java:<version>'
        classpath 'gradle.plugin.org.inferred:gradle-processors:2.1.0'
    }
}

repositories {
    mavenCentral()
}

apply plugin: 'java'
apply plugin: 'com.palantir.baseline'
```

Run **`./gradlew baselineUpdateConfig`** to download config files and extract them to the `.baseline/` directory.  These files should be committed to your repository to ensure reproducible builds.

_Tip: Install the [CheckStyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) plugin to run checkstyle from within IntelliJ._

## Selective usage
Alternatively, you can apply plugins selectively, e.g.:

```Gradle
apply plugin: 'com.palantir.baseline-config'

allprojects {
    apply plugin: 'com.palantir.baseline-idea'
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'com.palantir.baseline-checkstyle'
}
```

## com.palantir.baseline-idea
Run `./gradlew idea` to (re-) generate IntelliJ project and module files from the templates in `.baseline`. The
generated project is pre-configured with Baseline code style settings and support for the CheckStyle-IDEA plugin.

The `com.palantir.baseline-idea` plugin automatically applies the `idea` plugin.

Generated IntelliJ projects have default per-project code formatting rules as well as Checkstyle configuration. The JDK
and Java language level settings are picked up from the Gradle `sourceCompatibility` property on a per-module basis.

## com.palantir.baseline-eclipse
Run `./gradlew eclipse` to repopulate projects from the templates in `.baseline`.

The `com.palantir.baseline-eclipse` plugin automatically applies the `eclipse` plugin, but not the `java` plugin. The
`com.palantir.baseline-eclipse` plugin has no effects if the `java` plugin is not applied.

If set, `sourceCompatibility` is used to configure the Eclipse project settings and the Eclipse JDK version. Note
that `targetCompatibility` is also honored and defaults to `sourceCompatibility`.

Generated Eclipse projects have default per-project code formatting rules as well as Checkstyle configuration.

The Eclipse plugin is compatible with the following versions: Checkstyle 7.5+, JDK 1.7, 1.8

## com.palantir.baseline-error-prone
The `com.palantir.baseline-error-prone` plugin brings in the `net.ltgt.errorprone-javacplugin` plugin. The minimal setup is as follows:

```groovy
apply plugin: 'com.palantir.baseline-error-prone'
```

Error-prone rules can be suppressed on a per-line or per-block basis just like Checkstyle rules:

```Java
@SuppressWarnings("Slf4jConstantLogMessage")
```

Rules can be suppressed at the project level, or have their severity modified, by adding the following to the project's `build.gradle`:

```gradle
tasks.withType(JavaCompile).configureEach(new Action<Task>() {
    public void execute(Task task) {
        task.options.errorprone.disable 'Slf4jLogsafeArgs'
    }
})
```

To turn all of error-prone's warnings into errors:

```gradle
allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs += ['-Werror']
    }
}
```

More information on error-prone severity handling can be found at [errorprone.info/docs/flags](http://errorprone.info/docs/flags).

#### Baseline error-prone checks
Baseline configures the following checks in addition to the [error-prone's out-of-the-box
checks](https://errorprone.info):

- `DangerousParallelStreamUsage`: Discourage the use of Java parallel streams.
- `Slf4jConstantLogMessage`: Allow only compile-time constant slf4j log message strings.
- `Slf4jLevelCheck`: Slf4j level checks (`if (log.isInfoEnabled()) {`) must match the most severe level in the containing block.
- `Slf4jLogsafeArgs`: Allow only com.palantir.logsafe.Arg types as parameter inputs to slf4j log messages. More information on
Safe Logging can be found at [github.com/palantir/safe-logging](https://github.com/palantir/safe-logging).
- `PreferCollectionTransform`: Prefer Guava's Lists.transform or Collections2.transform instead of Iterables.transform when first argument's declared type is a List or Collection type for performance reasons.
- `PreferListsPartition`: Prefer Guava's `Lists.partition(List, int)` instead of `Iterables.partition(Iterable, int)` when first argument's declared type is a list for performance reasons.
- `PreferSafeLoggableExceptions`: Users should throw `SafeRuntimeException` instead of `RuntimeException` so that messages will not be needlessly redacted when logs are collected:
    ```diff
    -throw new RuntimeException("explanation", e); // this message will be redacted when logs are collected
    +throw new SafeRuntimeException("explanation", e); // this message will be preserved (allowing easier debugging)
    ```
- `PreferSafeLoggingPreconditions`: Users should use the safe-logging versions of Precondition checks for standardization when there is equivalent functionality
    ```diff
    -com.google.common.base.Preconditions.checkNotNull(variable, "message");
    +com.palantir.logsafe.Preconditions.checkNotNull(variable, "message"); // equivalent functionality is available in the safe-logging variant
    ```
- `ShutdownHook`: Applications should not use `Runtime#addShutdownHook`.
- `GradleCacheableTaskAction`: Gradle plugins should not call `Task.doFirst` or `Task.doLast` with a lambda, as that is not cacheable. See [gradle/gradle#5510](https://github.com/gradle/gradle/issues/5510) for more details.
- `PreferBuiltInConcurrentKeySet`: Discourage relying on Guava's `com.google.common.collect.Sets.newConcurrentHashSet()`, when Java's `java.util.concurrent.ConcurrentHashMap.newKeySet()` serves the same purpose.
- `JUnit5RuleUsage`: Prevent accidental usage of `org.junit.Rule`/`org.junit.ClassRule` within Junit5 tests
- `DangerousCompletableFutureUsage`: Disallow CompletableFuture asynchronous operations without an Executor.
- `NonComparableStreamSort`: Stream.sorted() should only be called on streams of Comparable types.
- `DangerousStringInternUsage`: Disallow String.intern() invocations in favor of more predictable, scalable alternatives.
- `OptionalOrElseThrowThrows`: Optional.orElseThrow argument must return an exception, not throw one.
- `OptionalOrElseGetValue`: Prefer `Optional.orElse(value)` over `Optional.orElseGet(() -> value)` for trivial expressions.
- `OptionalOrElseMethodInvocation`: Prefer `Optional.orElseGet(() -> methodInvocation())` over `Optional.orElse(methodInvocation())`.
- `LambdaMethodReference`: Lambda should use a method reference.
- `SafeLoggingExceptionMessageFormat`: SafeLoggable exceptions do not interpolate parameters.
- `StrictUnusedVariable`: Functions shouldn't have unused parameters.
- `StringBuilderConstantParameters`: StringBuilder with a constant number of parameters should be replaced by simple concatenation.
- `JUnit5SuiteMisuse`: When migrating from JUnit4 -> JUnit5, classes annotated with `@RunWith(Suite.class)` are dangerous because if they reference any JUnit5 test classes, these tests will silently not run!
- `ThrowError`: Prefer throwing a RuntimeException rather than Error.
- `DnsLookup`: Calling `new InetSocketAddress(host, port)` results in a DNS lookup which prevents the address from following DNS changes.
- `ReverseDnsLookup`: Calling address.getHostName may result in an unexpected DNS lookup.
- `ReadReturnValueIgnored`: The result of a read call must be checked to know if EOF has been reached or the expected number of bytes have been consumed.
- `FinalClass`: A class should be declared final if all of its constructors are private.
- `RedundantModifier`: Avoid using redundant modifiers.
- `StrictCollectionIncompatibleType`: Likely programming error due to using the wrong type in a method that accepts Object.
- `InvocationHandlerDelegation`: InvocationHandlers which delegate to another object must catch and unwrap InvocationTargetException.
- `Slf4jThrowable`: Slf4j loggers require throwables to be the last parameter otherwise a stack trace is not produced.
- `JooqResultStreamLeak`: Autocloseable streams and cursors from jOOQ results should be obtained in a try-with-resources statement.
- `StreamOfEmpty`: Stream.of() should be replaced with Stream.empty() to avoid unnecessary varargs allocation.
- `RedundantMethodReference`: Redundant method reference to the same type.
- `ExceptionSpecificity`: Prefer more specific catch types than Exception and Throwable.
- `ThrowSpecificity`: Prefer to declare more specific `throws` types than Exception and Throwable.
- `UnsafeGaugeRegistration`: Use TaggedMetricRegistry.registerWithReplacement over TaggedMetricRegistry.gauge.
- `CollectionStreamForEach`: Collection.forEach is more efficient than Collection.stream().forEach.
- `LoggerEnclosingClass`: Loggers created using getLogger(Class<?>) must reference their enclosing class.
- `UnnecessaryLambdaArgumentParentheses`: Lambdas with a single parameter do not require argument parentheses.
- `RawTypes`: Avoid raw types; add appropriate type parameters if possible.
- `VisibleForTestingPackagePrivate`: `@VisibleForTesting` members should be package-private.
- `OptionalFlatMapOfNullable`: Optional.map functions may return null to safely produce an empty result.
- `ExtendsErrorOrThrowable`: Avoid extending Error (or subclasses of it) or Throwable directly.
- `ImmutablesStyle`: Disallow the use of inline immutables style annotations to avoid forcing compile dependencies on consumers.
- `ImmutablesReferenceEquality`: Comparison of Immutables value using reference equality instead of value equality.
- `TooManyArguments`: Prefer Interface that take few arguments rather than many.
- `ObjectsHashCodeUnnecessaryVarargs`: java.util.Objects.hash(non-varargs) should be replaced with java.util.Objects.hashCode(value) to avoid unnecessary varargs array allocations.
- `PreferStaticLoggers`: Prefer static loggers over instance loggers.
- `LogsafeArgName`: Prevent certain named arguments as being logged as safe. Specify unsafe argument names using `LogsafeArgName:UnsafeArgNames` errorProne flag.
- `ImplicitPublicBuilderConstructor`: Prevent builders from unintentionally leaking public constructors.
- `ImmutablesBuilderMissingInitialization`: Prevent building Immutables.org builders when not all fields have been populated.
- `UnnecessarilyQualified`: Types should not be qualified if they are also imported.
- `DeprecatedGuavaObjects`: `com.google.common.base.Objects` has been obviated by `java.util.Objects`.
- `JavaTimeSystemDefaultTimeZone`: Avoid using the system default time zone.
- `ZoneIdConstant`: Prefer `ZoneId` constants.
- `IncubatingMethod`: Prevents calling Conjure incubating APIs unless you explicitly opt-out of the check on a per-use or per-project basis.
- `CompileTimeConstantViolatesLiskovSubstitution`: Requires consistent application of the `@CompileTimeConstant` annotation to resolve inconsistent validation based on the reference type on which the met is invoked.
- `ConsistentLoggerName`: Ensure Loggers are named consistently.
- `PreferImmutableStreamExCollections`: It's common to use toMap/toSet/toList() as the terminal operation on a stream, but would be extremely surprising to rely on the mutability of these collections. Prefer `toImmutableMap`, `toImmutableSet` and `toImmutableList`. (If the performance overhead of a stream is already acceptable, then the `UnmodifiableFoo` wrapper is likely tolerable).
- `DangerousIdentityKey`: Key type does not override equals() and hashCode, so comparisons will be done on reference equality only.
- `DangerousRecordArrayField`: Array fields in records perform reference equality when comparing records.
- `ConsistentOverrides`: Ensure values are bound to the correct variables when overriding methods
- `FilterOutputStreamSlowMultibyteWrite`: Subclasses of FilterOutputStream should provide a more efficient implementation of `write(byte[], int, int)` to avoid slow writes.
- `BugCheckerAutoService`: Concrete BugChecker implementations should be annotated `@AutoService(BugChecker.class)` for auto registration with error-prone.
- `DangerousCollapseKeysUsage`: Disallow usage of `EntryStream#collapseKeys()`.
- `JooqBatchWithoutBindArgs`: jOOQ batch methods that execute without bind args can cause performance problems.
- `InvocationTargetExceptionGetTargetException`: InvocationTargetException.getTargetException() predates the general-purpose exception chaining facility. The Throwable.getCause() method is now the preferred means of obtaining this information. [(source)](https://docs.oracle.com/en/java/javase/17/docs/api//java.base/java/lang/reflect/InvocationTargetException.html#getTargetException())
- `PreferInputStreamTransferTo`: Prefer JDK `InputStream.transferTo(OutputStream)` over utility methods such as `com.google.common.io.ByteStreams.copy(InputStream, OutputStream)`, `org.apache.commons.io.IOUtils.copy(InputStream, OutputStream)`, `org.apache.commons.io.IOUtils.copyLong(InputStream, OutputStream)`.
- `ConjureEndpointDeprecatedForRemoval`: Conjure endpoints marked with Deprecated and `forRemoval = true` should not be used as they are scheduled to be removed.

### Programmatic Application

There exist a number of programmatic code modifications available via [error-prone](https://errorprone.info). You can run these on your code to apply some refactorings automatically:

```bash
./gradlew compileJava compileTestJava -PerrorProneApply
```

You may apply specific error-prone refactors including those which are not enabled by default by providing a comma
delimited list of check names to the `-PerrorProneApply` option.

```bash
./gradlew compileJava compileTestJava -PerrorProneApply=ThrowSpecificity
```

## com.palantir.baseline-checkstyle
Checkstyle rules can be suppressed on a per-line or per-block basis. (It is good practice to first consider formatting
the code block in question according to the project's style guidelines before adding suppression statements.) To
suppress a particular check, say `MagicNumberCheck`, from an entire class or method, annotate the class or method with
the lowercase check name without the "Check" suffix:

```Java
@SuppressWarnings("checkstyle:magicnumber")
```

Checkstyle rules can also be suppressed using comments, which is useful for checks such as `IllegalImport` where
annotations cannot be used to suppress the violation. To suppress checks for particular lines, add the comment
`// CHECKSTYLE:OFF` before the first line to suppress and add the comment `// CHECKSTYLE:ON` after the last line.

To disable certain checks for an entire file, apply [custom suppressions](http://checkstyle.sourceforge.io/config.html)
in `.baseline/checkstyle/custom-suppressions.xml`. Avoid adding suppressions to the autogenerated `.baseline/checkstyle/checkstyle-suppressions.xml`,
as that file will be overridden on updates.

### Copyright Checks

Baseline enforces Palantir copyright at the beginning of files when applying `com.palantir.baseline-format`. To change this, edit the template copyrights
in `.baseline/copyright/*.txt`. The largest file (sorted lexicographically) will be used to generate a new copyright if one is missing, or none of the existing templates match.

To automatically update all files with mismatching/missing copyrights, run `./gradlew format`.

## com.palantir.baseline-class-uniqueness
When applied to a java project, this inspects all the jars in your `runtimeClasspath` configuration and records any conflicts to a `baseline-class-uniqueness.lock` file. For example:

```
# Danger! Multiple jars contain identically named classes. This may cause different behaviour depending on classpath ordering.
# Run ./gradlew checkClassUniqueness --write-locks to update this file

## runtimeClasspath
[jakarta.annotation:jakarta.annotation-api, javax.annotation:javax.annotation-api]
  - javax.annotation.Resource$AuthenticationType
[jakarta.ws.rs:jakarta.ws.rs-api, javax.ws.rs:javax.ws.rs-api]
  - javax.ws.rs.BadRequestException
  - javax.ws.rs.ClientErrorException
  - javax.ws.rs.ForbiddenException
  - javax.ws.rs.InternalServerErrorException
  - javax.ws.rs.NotAcceptableException
  - javax.ws.rs.NotAllowedException
  - javax.ws.rs.NotAuthorizedException
  - javax.ws.rs.NotFoundException
  - javax.ws.rs.NotSupportedException
  - javax.ws.rs.Priorities
```

This task can also be used to analyze other configurations in addition to `runtimeClasspath`, e.g.:

```gradle
checkClassUniqueness {
  configurations.add project.configurations.myConf
}
```

If you discover multiple jars on your classpath contain clashing classes, you should ideally try to fix them upstream and then depend on the fixed version.  If this is not feasible, you may be able to tell Gradle to [use a substituted dependency instead](https://docs.gradle.org/current/userguide/resolution_rules.html#sec:dependency_resolve_rules):

```gradle
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.name == 'log4j') {
            details.useTarget group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.10'
            details.because "prefer 'log4j-over-slf4j' over any version of 'log4j'"
        }
    }
}
```

## com.palantir.baseline-circleci

The plugin surfaces failures using JUnit XML which is rendered nicely by CircleCI, by

1. Storing JUnit test reports in `$CIRCLE_TEST_REPORTS/junit`
2. Storeing the HTML output of tests in `$CIRCLE_ARTIFACTS/junit`

## com.palantir.baseline-format

Adds a `./gradlew format` task which autoformats all Java files using [Spotless](https://github.com/diffplug/spotless). Roughly equivalent to:

```gradle
buildscript {
    dependencies {
        classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.7.0'
    }
}

apply plugin: 'com.palantir.java-format'
apply plugin: 'com.diffplug.spotless'

spotless {
    java {
        target 'src/main/java/**/*.java', 'src/main/test/**/*.java'
        removeUnusedImports
        importOrder ''
        trimTrailingWhitespace
        indentWithSpaces 4
    }
    groovyGradle {
        greclipse().configFile("$rootDir/build/baseline-format/greclipse.properties")
    }
}
```

**Add `com.palantir.baseline-format.eclipse=true`** to your gradle.properties to format entire files with the Eclipse formatter. The Eclipse formatter can be run from IntelliJ using the [Eclipse Code Formatter](https://plugins.jetbrains.com/plugin/6546-eclipse-code-formatter) plugin.

To iterate on the eclipse.xml formatter config, you can import it into an instance of Eclipse, edit it through the preferences UI and then export it, or you can manually tune individual values by referring to the master list of [DefaultCodeFormatterConstants](https://github.com/eclipse/eclipse.jdt.core/blob/6a8cee1126829229d648db4ae0e5a6b70a5d4f13/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java) and [DefaultCodeFormatterOptions](https://github.com/eclipse/eclipse.jdt.core/blob/6a8cee1126829229d648db4ae0e5a6b70a5d4f13/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java#L41-L95). Running `./gradlew :gradle-baseline-java:test -Drecreate=true` should update all the checked-in snapshot test cases.

**Add `com.palantir.baseline-format.gradle-files=true`** to your gradle.properties to format your own build.gradle files
(or alternatively run `./gradlew format -Pcom.palantir.baseline-format.gradle-files=true` to do a one-off run).

## com.palantir.baseline-reproducibility

This plugin is a shorthand for the following snippet, which opts-in to reproducible behaviour for all Gradle's Jar, Tar and Zip tasks. (Surprisingly, these tasks are not reproducible by default).

```gradle
tasks.withType(AbstractArchiveTask) {
    preserveFileTimestamps = false
    reproducibleFileOrder = true
}
```

It also warns if it detects usage of the [`nebula.info`](https://github.com/nebula-plugins/gradle-info-plugin) plugin which is known to violate the reproducibility of Jars by adding a 'Build-Date' entry to the MANIFEST.MF, which will be different on every run of `./gradlew jar`.

_Complete byte-for-byte reproducibility is desirable because it enables the [Gradle build cache](https://docs.gradle.org/4.10/userguide/build_cache.html) to be much more effective._

## com.palantir.baseline-exact-dependencies

This plugin adds two tasks to help users ensure they explicitly declare exactly the dependencies they need - nothing more and nothing less:

- `checkUnusedDependencies` - fails if a project pulls in a jar but never compiles against classes from it.  This is undesirable because it inflates published jars and distributions.
- `checkImplicitDependencies` - fails if source code relies on classes that only appear on the classpath transitively.  This is fragile because without a direct dependency on the relevant jar, a seemingly unrelated dependency upgrade could cause compilation to start failing.

Both of these tasks can be configured to ignore specific dependencies if this improves the signal-to-noise ratio. The following snippet illustrates the defaults that are baked into the plugin:

```gradle
checkUnusedDependencies {
    ignore 'javax.annotation', 'javax.annotation-api'
}

checkImplicitDependencies {
    ignore 'org.slf4j', 'slf4j-api'
}
```

## com.palantir.baseline-encoding

This plugin sets the encoding for JavaCompile tasks to `UTF-8`.

## com.palantir.baseline-release-compatibility

This plugin adds the `--release <number>` flag to JavaCompile tasks (when the compiler [supports it](https://openjdk.java.net/jeps/247)), so that published jars will only use methods available in the target JRE.  Relying on `sourceCompatibility = 1.8` and `targetCompatibility = 1.8` is insufficient because you run the risk of using method that have been added in newer JREs, e.g. `Optional#isEmpty`.

This plugin may become redundant if this functionality is implemented upstream [in Gradle](https://github.com/gradle/gradle/issues/2510).

## com.palantir.baseline-testing

Configures some sensible defaults:

1. For debugging purposes:

    ```gradle
    tasks.withType(Test) {
        jvmArgs '-XX:+HeapDumpOnOutOfMemoryError', '-XX:+CrashOnOutOfMemoryError'
    }
    ```

    This ensures that if one of your tests fails with an OutOfMemoryError (OOM), you'll get a large hprof file in the relevant subdirectory which can be analyzed with Eclipse Memory Analyzer Tool, Yourkit profiler, jvisualvm etc.

2. If Gradle detects you use JUnit 5 (i.e. you have a `testImplementation 'org:junit.jupiter:junit-jupiter'` dependency), it will automatically configure your `Test` tasks to run with `useJUnitPlatform()`, and configure all `@Test` methods to run in parallel by default.  Many other languages take this stance by default - if some tests rely on static state then you can mark them as non-parallel.

    See more here: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution

The plugin also adds a `checkJUnitDependencies` to make the migration to JUnit5 safer.  Specifically, it should prevent cases where the tests could silently not run due to misconfigured dependencies.

3. For repos that use 'snapshot' style testing, it's convenient to have a single command to accept the updated snapshots after a code change.
This plugin ensures that if you run tests with `./gradlew test -Drecreate=true`, the system property will be passed down to the running Java process (which can be detected with `Boolean.getBoolean("recreate")`).

## com.palantir.baseline-immutables

This plugin enables incremental compilation for the [Immutables](http://immutables.github.io/) annotation processor.

This plugin adds the `-Aimmutables.gradle.incremental` compiler arg to the compile Java task for any source set whose annotation processor configuration contains the Immutables annotation processor.

For more details, see the Immutables incremental compilation [tracking issue](https://github.com/immutables/immutables/issues/804).

## com.palantir.baseline-java-versions

This plugin allows consistent configuration of JDK versions via [Gradle Toolchains](https://docs.gradle.org/current/userguide/toolchains.html).
The plugin is currently used on an opt-in basis. To use it, apply the plugin and configure the default JDK versions in your root project (note that the plugin requires Gradle 7):

```gradle
// In the root build.gradle
apply plugin: 'com.palantir.baseline-java-versions'

javaVersions {
    libraryTarget = 11
    distributionTarget = 15
    runtime = 17
}
```

The configurable fields of the `javaVersions` extension are:
* `libraryTarget`: (required) The Java version used for compilation of libraries that are published.
* `distributionTarget`: (optional) The Java version used for compilation of code used within distributions, but not published externally. Defaults to the `libraryTarget` version.
* `runtime`: (optional) Runtime Java version for testing and packaging distributions. Defaults to the `distributionTarget` version.

The configured Java versions are used as defaults for all projects.

If a sub-project should use `libraryTarget` but is not considered a library (for example, because it is not published), you can explicitly indicate that it is a library:

```gradle
// In a sub-project's build.gradle
javaVersion {
    library()
}
```

A sub-project can also explicitly override the default Java versions, but doing so is discouraged:

```gradle
// In a sub-project's build.gradle
javaVersion {
    target = 11
    runtime = 11
}
```

The optionally configurable fields of the `javaVersion` extension are:
* `target`: The target version used for compilation.
* `runtime`: The runtime version used for testing and distributions.

### Opting in to `--enable-preview` flag

As described in [JEP 12](https://openjdk.java.net/jeps/12), Java allows you to use incubating syntax features if you add the `--enable-preview` flag. Gradle requires you to add it in many places (including on JavaCompile, Javadoc tasks, as well as in production and on execution tasks like Test, JavaExec). The baseline-java-versions plugin provides a shorthand way of enabling this:

```gradle
// root build.gradle
apply plugin: 'com.palantir.baseline-java-versions'
javaVersions {
    libraryTarget = 11
    distributionTarget = '17_PREVIEW'
    runtime = '17_PREVIEW'
}

// shorthand for configuring all the tasks individually, e.g.
tasks.withType(JavaCompile) {
    options.compilerArgs += "--enable-preview"
}
tasks.withType(Test) {
    jvmArgs += "--enable-preview"
}
tasks.withType(JavaExec) {
    jvmArgs += "--enable-preview"
}
```

In the example above, the `Baseline-Enable-Preview: 17` attribute will be embedded in the resultant Jar's `META-INF/MANIFEST.MF` file. To see for yourself, run:

```
$ unzip -p /path/to/your-project-1.2.3.jar META-INF/MANIFEST.MF
```

_Note, this plugin should be used with **caution** because preview features may change or be removed, which might make upgrading to a new Java version harder._


# Citizen Intelligence Agency

The Citizen Intelligence Agency is a volunteer-driven, open-source intelligence (OSINT) project focusing on political activity in Sweden. By monitoring key political figures and institutions, the platform provides valuable insights into financial performance, risk metrics, and political trends. The dashboard features a ranking system, enabling users to objectively compare politicians based on performance. The initiative is independent and non-partisan, seeking to encourage informed decision-making, enhance transparency in governance, and cultivate an engaged and well-informed citizenry.

## About Hack23

- Website: [www.hack23.com](https://www.hack23.com/)
- LinkedIn: [in/jamessorling](https://www.linkedin.com/in/jamessorling)

## Data Sources

The project relies on open data from various sources, including:

- [Swedish Parliament Open Data](http://data.riksdagen.se/): Offers a wide range of data related to the Swedish Parliament, including members, committees, and documents.
- [Swedish Election Authority](http://www.val.se/): Provides information on election processes, results, and political parties in Sweden.
- [World Bank Open Data](http://data.worldbank.org/): Contains global development data, including economic indicators and demographic information.
- [Swedish National Financial Management Authority (ESV) Public Sector Information (PSI) Data](https://www.esv.se/): Offers data on government finances, economic trends, and public sector operations in Sweden.

## Badges

[![license](https://img.shields.io/github/license/Hack23/cia.svg)](https://raw.githubusercontent.com/Hack23/cia/master/citizen-intelligence-agency/LICENSE.txt)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FHack23%2Fcia.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FHack23%2Fcia?ref=badge_shield)
[![CLA assistant](https://cla-assistant.io/readme/badge/Hack23/cia)](https://cla-assistant.io/Hack23/cia)
[![Maven Central](https://img.shields.io/maven-central/v/com.hack23.cia/cia-dist-deb.svg)](http://mvnrepository.com/artifact/com.hack23.cia/cia-dist-deb)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/770/badge)](https://bestpractices.coreinfrastructure.org/projects/770)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Hack23/cia/badge)](https://api.securityscorecards.dev/projects/github.com/Hack23/cia)
[![CodeFactor](https://www.codefactor.io/repository/github/hack23/cia/badge)](https://www.codefactor.io/repository/github/hack23/cia)
[![Maintainability](https://api.codeclimate.com/v1/badges/14cc2db98322e8338ef1/maintainability)](https://codeclimate.com/github/Hack23/cia/maintainability)
[![codebeat badge](https://codebeat.co/badges/5a7cf18f-68cb-4535-b197-8b541bf9bb7c)](https://codebeat.co/projects/github-com-hack23-cia-master)
[![DepShield Badge](https://depshield.sonatype.org/badges/Hack23/cia/depshield.svg)](https://depshield.github.io)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/Hack23/cia.svg)](http://isitmaintained.com/project/Hack23/cia "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/Hack23/cia.svg)](http://isitmaintained.com/project/Hack23/cia "Percentage of issues still open")

## Runtime(JDK 21+)

[![JDK-21](https://img.shields.io/badge/jdk-21-green.svg)]
[![JDK-22](https://img.shields.io/badge/jdk-22-orange.svg)]

## Resources

- [Project Documentation](http://hack23.github.io/cia/)
- [Project Architecture](http://hack23.github.io/cia/architecture.html) - Delve into the architecture of the Citizen Intelligence Agency. This overview provides a look at the enterprise context, system context, system containers, web application components, deployment strategy, and AWS account structure of the project.
- [Entity Model](https://hack23.github.io/cia/service.data.impl/hbm2doc/entities/index.html) - Explore our Entity Model which provides a detailed look at the entities in our system and their relationships. This page is particularly useful for understanding the data structure of our project.
- [Api docs](https://hack23.github.io/cia/apidocs/index.html) - Access the API documentation for the Citizen Intelligence Agency project. This documentation provides a detailed view of the various packages within the system, helping developers understand and work with the project's API.

## Citizen Intelligence Agency - Sweden Political Activity Dashboard

Welcome to the Citizen Intelligence Agency - Sweden Political Activity Dashboard repository. This project provides a comprehensive and neutral dashboard focusing on political activity in Sweden. By monitoring key political figures and institutions, we offer valuable insights into financial performance, risk metrics, and political trends.

## [Dashboard](https://github.com/Hack23/cia/blob/master/dashboard.md)

Our [dashboard](https://github.com/Hack23/cia/blob/master/dashboard.md) offers a detailed overview of political figures, comprehensive data on various ministries, performance metrics, and visual data representation. Check out our [dashboard.md](https://github.com/Hack23/cia/blob/master/dashboard.md) for more details.

## Medborgarunderrättelsebyrån - Sverige Politisk aktivitetsdashboard

Medborgarunderrättelsebyrån tillhandahåller en neutral och omfattande dashboard som fokuserar på politisk aktivitet i Sverige. Genom att övervaka nyckelpolitiska figurer och institutioner erbjuder plattformen värdefulla insikter i finansiell prestanda, riskmetriker och politiska trender. Detta projekt drivs av avancerade AI-teknologier som [OpenAI](https://www.openai.com/) och datavisualiseringsverktyg som [Daigram](https://daigr.am/).

Vår [dashboard](https://github.com/Hack23/cia/blob/master/dashboard_sv.md) erbjuder en detaljerad översikt över politiska figurer, omfattande data om olika departement, prestandametriker och visuell datarepresentation. Kolla in vår [dashboard_sv.md](https://github.com/Hack23/cia/blob/master/dashboard_sv.md) för mer information.

## AI and Data Visualization

This project is powered by advanced AI technologies like OpenAI for data processing and analysis. We use AI to process and analyze a large amount of data from various open sources such as the Swedish Parliament, Swedish Election Authority, World Bank, and the Swedish National Financial Management Authority. The analyzed data is then represented visually through data visualization tools like Daigram.

## Reporting Security Issues

Please follow the instructions in our [SECURITY.md](https://github.com/Hack23/cia/blob/master/SECURITY.md) file for reporting security issues.

Here's an updated `README.md` section with a link to the CloudFormation stack file and instructions on how to launch it in AWS:

## Deploying to AWS using CloudFormation

The Citizen Intelligence Agency (CIA) project can be deployed on AWS using the provided CloudFormation stack file. This file is located in the `cia-dist-cloudformation/src/main/resources/cia-dist-cloudformation.json` folder.

You can find the CloudFormation stack file [here](cia-dist-cloudformation/src/main/resources/cia-dist-cloudformation.json).

### Launching the CloudFormation Stack

To launch the CloudFormation stack, follow these steps:

1. Log in to your AWS Management Console.

2. Navigate to the CloudFormation service.

3. Click on **Create stack**.

4. In the **Select Template** section, choose **Upload a template file** and upload the `cia-dist-cloudformation.json` file.

5. Click **Next**.

6. Fill out the **Stack name** and any required parameters. The parameters are described in the CloudFormation stack file. Adjust them according to your requirements.

7. Click **Next** to configure stack options. You can add tags or configure advanced options as needed.

8. Click **Next** to review your stack settings. Make sure everything is set up as desired.

9. In the **Capabilities** section, check the boxes for the following options:
   - I acknowledge that AWS CloudFormation might create IAM resources.
   - I acknowledge that AWS CloudFormation might create IAM resources with custom names.

10. Click **Create stack** to start the stack creation process. AWS CloudFormation will create the required resources and deploy the CIA project.

11. Once the stack creation process is complete, you can access the application by navigating to the output URL provided in the CloudFormation stack Outputs tab.

# Installing Debian/Ubuntu package

This guide will walk you through installing the CIA project on Debian and Ubuntu 22.4+ systems.

## Prerequisites

1. Install OpenJDK and PostgreSQL:

```bash
$ sudo apt-get install openjdk-21-jdk postgresql-15 pgadmin3
```

2. Install PostgreSQL on Ubuntu:

```bash
$ sudo apt-get install postgresql-15 postgresql-contrib postgresql-15-pgaudit
```

## Database Setup

3. Create an empty database:

Below instructions set the default username/password and database name used for development. We recommend using custom credentials and updating the configuration at `/opt/cia/webapps/cia/WEB-INF/database.properties` to define your own username/password and database name.

```bash
$ sudo su - postgres
$ psql
postgres=# CREATE USER eris WITH password 'discord';
postgres=# CREATE DATABASE cia_dev;
postgres=# GRANT ALL PRIVILEGES ON DATABASE cia_dev to eris;
```

## PostgreSQL Configuration

4. Enable prepared transactions and required extensions:

Edit `/etc/postgresql/15/main/postgresql.conf` and set:

```ini
max_prepared_transactions = 100
```

```ini
shared_preload_libraries = 'pg_stat_statements, pgaudit, pgcrypto'
pgaudit.log = ddl
pg_stat_statements.track = all
pg_stat_statements.max = 10000
```

5. Modify PostgreSQL settings:

Edit `/etc/postgresql/15/main/pg_hba.conf` and add the following line:

```ini
host all all ::1/128 md5
```

6. Restart PostgreSQL:

```bash
$ service postgresql restart
```

## Install CIA Debian Package

7. Download the CIA Debian package:

```bash
$ wget https://oss.sonatype.org/content/repositories/releases/com/hack23/cia/cia-dist-deb/2022.12.26/cia-dist-deb-2022.12.26.deb
```

8. Install the Debian package:

```bash
$ sudo dpkg -i cia-dist-deb-2022.12.26.deb
```

## Access the Server

9. Access the server at [https://localhost:28443/cia/](https://localhost:28443/cia/).

## Diagrams

- ![Cloudformation stack Diagram](cia-dist-cloudformation/src/main/resources/cia-dist-cloudformation.png)
- ![Package overview diagram](https://hack23.github.io/cia/apidocs/package-dependencies.svg)


A fully customizable user management REST API.

  Read the Documentation

  Features •
  Running Locally •
  Running on Kubernetes •
  Client Libraries •
  Changelog

## Features

- Connects to AWS DynamoDB or MongoDB
- REST API for CRUD (Create/Retrieve/Update/Delete) operations
- Built-in email verification with AWS Simple Email Service
- Server-side password hashing
- Support for both Basic Auth and OAuth 2.0
- Customizable user properties with validation
- Customizable email message contents
- Generated OpenAPI (Swagger) specification
- Metrics and healthchecks
- Official Docker Image and Helm Chart
  - [Docker Hub](https://hub.docker.com/r/rohannagar/thunder/)
  - [GitHub Container Registry](https://github.com/users/RohanNagar/packages/container/package/thunder)
- Multiple native [client libraries](https://thunder-api.readthedocs.io/en/latest/manual/client-libraries.html)

## Running Locally
Fork this repo on GitHub. Then, clone your forked repo onto your machine
and navigate to the created directory.

```bash
$ git clone YOUR-FORK-URL
$ cd thunder
```

Compile and package the source code with Maven.

```bash
$ mvn package
```

Start up local dependencies (DynamoDB and SES) in the background so that Thunder can perform all functionality.

```bash
$ node scripts/tools/run-local-dependencies.js &
```

Run the packaged jar.

```bash
$ java -jar application/target/application-*.jar server config/local-dev-config.yaml
```

Thunder should now be running on localhost port 8080!

## Running on Kubernetes

The official Thunder Docker image is published on [Docker Hub](https://hub.docker.com/r/rohannagar/thunder/).

Thunder is deployed through a Helm chart. See the `scripts/deploy/helm/thunder` directory for steps
on deploying through Helm.

## Further Documentation

Full documentation can be found on [ReadTheDocs](https://thunder-api.readthedocs.io/en/latest/).
For Thunder development documentation, refer to the [wiki](https://github.com/RohanNagar/thunder/wiki)
for information on how to build and write tests.


# Scylla tools

This repository contains `nodetool` and other Apache Cassandra compatible tools for Scylla.

Please refer to the [Scylla git repository](https://github.com/scylladb/scylla) for more information how to build and run the tools.


= Brooklin

image:https://img.shields.io/github/license/linkedin/brooklin.svg[link="https://github.com/linkedin/brooklin/blob/master/LICENSE"]
image:https://img.shields.io/badge/bintray-v5.1.0-blue.svg?style=popout[link="https://bintray.com/linkedin/maven/brooklin"]
image:https://img.shields.io/gitter/room/linkedin/kafka.svg?style=popout[link="https://gitter.im/linkedin/brooklin"]
image:https://img.shields.io/github/last-commit/linkedin/brooklin.svg?style=popout[link="https://github.com/linkedin/brooklin/commits/master"]
image:https://img.shields.io/github/issues/linkedin/brooklin/bug.svg?color=orange?style=popout[link="https://github.com/linkedin/brooklin/labels/bug"]

image::images/brooklin-overview.svg[Brooklin Overview]
{empty} +
Brooklin is a distributed system intended for streaming data between various heterogeneous source and destination systems with high reliability and throughput at scale. Designed for multitenancy, Brooklin can simultaneously power hundreds of data pipelines across different systems and can easily be extended to support new sources and destinations.

== Distinguishing features

* *Extensible for any source and destination*
+
** Brooklin offers a flexible API that can be extended to support a wide variety of source and destination systems. It is not confined to single type of source or destination system.
** Source and destination systems can be freely mixed and matched. They do not have to be the same.

* *Scalable*
** Brooklin supports creating an arbitrary number of data streams that are processed concurrently and independently such that errors in one stream are isolated from the rest.
** Brooklin supports partitioned data streams throughout its core implementation and APIs.
** Brooklin can be deployed to a cluster of machines (scale out) to support as many data streams as desired.

* *Easy to operate and manage*
** Brooklin exposes a REST endpoint for managing data streams, that offers a rich set of operations on them in addition to CRUD (e.g. `pause` and `resume`).
** Brooklin also exposes a diagnostics REST endpoint that enables on-demand querying of a data stream's status.

* *Battle-tested at scale with Kafka*
** While it is not limited to any particular system, Brooklin provides capabilities for reading/writing massive amounts of data to/from Kafka with high reliability at scale. You can learn more about this in the <<Use cases>> section.

* *Supports Change Data Capture with bootstrap*
** Brooklin supports propagating https://en.wikipedia.org/wiki/Change_data_capture[Change Data Capture] events from data stores, e.g. RDBMS, KV stores ... etc.
** Brooklin also supports streaming a snapshot of the existing data before propagating change events.

== Use cases
=== Mirroring Kafka clusters

* *Multitenancy*
+
A single Brooklin cluster can be used to mirror data across several Kafka clusters.

* *Fault isolation across topic partitions*
+
One bad partition will not affect an entire Kafka topic. Mirroring will continue for all the other healthy partitions.

* *Whitelisting topics using regular expressions*
+
Select the topics to mirror using regular expression patterns against their names.

* *Pausing and resuming individual partitions*
+
Through its https://github.com/linkedin/brooklin/wiki/Brooklin-Architecture#rest-endpoints[Datastream Management Service (DMS)], Brooklin exposes REST APIs that allow finer control over replication pipelines, like being able to pause and resume individual partitions of a Kafka topic.

> Check out https://github.com/linkedin/brooklin/wiki/mirroring-kafka-clusters[Mirroring Kafka Clusters] to learn more about using Brooklin to mirror Kafka clusters.

=== Change Data Capture
* Brooklin supports propagating https://en.wikipedia.org/wiki/Change_data_capture[Change Data Capture] events from data stores, e.g. RDBMS, KV stores ... etc.
* Brooklin supports bootstrapping data from a datastore, i.e. streaming a snapshot of the existing data before any change events.
* MySQL support is currently under development.

=== Stream processing bridge
* Brooklin can be used as the underlying streaming infrastructure feeding data to Stream Processing systems, e.g. http://samza.apache.org/[Apache Samza], https://storm.apache.org/[Apache Storm], https://spark.apache.org/[Apache Spark], https://flink.apache.org/[Apache Flink].

== Trying out Brooklin
Feel free to check out our https://github.com/linkedin/brooklin/wiki/test-driving-brooklin[step-by-step tutorials] for running Brooklin locally in a few example scenarios.

== Documentation
https://github.com/linkedin/Brooklin/wiki[Brooklin Wiki Pages]

== Community
* Join our https://gitter.im/linkedin/brooklin[Brooklin chat room on Gitter]
* File a bug or request features using https://github.com/linkedin/Brooklin/issues[GitHub issues]

== Contributing
* https://github.com/linkedin/Brooklin/wiki/Developer-Guide[Developer Guide]
* https://github.com/linkedin/brooklin/blob/master/CODE_OF_CONDUCT.md[Code of Conduct]

== License
Copyright (c) LinkedIn Corporation. All rights reserved.
Licensed under the https://github.com/linkedin/brooklin/blob/master/LICENSE[BSD 2-Clause] License.


# scalecube-services
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.scalecube/scalecube-services-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.scalecube/scalecube-services-api)
[![SourceSpy Dashboard](https://sourcespy.com/shield.svg)](https://sourcespy.com/github/scalecubescalecubeservices/)

## MICROSERVICES 2.0

ScaleCube is a library that simplifies the development of reactive and distributed applications by providing an embeddable microservices library. It connects distributed microservices in a way that resembles a fabric when viewed collectively. It greatly simplifies and streamlines asynchronous programming and provides a tool-set for managing microservices architecture. ScaleCube is built based on ScaleCube Cluster, which provides a built-in service discovery. The discovery uses SWIM protocol and gossip that scales better and has inherent failure detection and superior coherent understanding of the cluster state and cluster membership taking part in a swarm of services. ScaleCube cluster is a membership protocol that maintains membership amongst processes in a distributed system

    An open-source project that is focused on streamlining reactive-programming of Microservices Reactive-systems that scale, built by developers for developers.

ScaleCube Services provides a low latency Reactive Microservices library for peer-to-peer service registry and discovery
based on gossip protocol, without single point-of-failure or bottlenecks.

    Scalecube more gracefully address the cross cutting concernes of distributed microservices architecture.

ScaleCube Services Features:

* Provision and interconnect microservices peers in a cluster
* Fully Distributed with No single-point-of-failure or single-point-of-bottleneck
* Fast - Low latency and high throughput
* Scaleable over- cores, jvms, clusters, regions.
* Built-in Service Discovery and service routing
* Zero configuration, automatic peer-to-peer service discovery using SWIM cluster membership protocol
* Simple non-blocking, asynchronous programming model
* Reactive Streams support.
  * Fire And Forget - Send and not wait for a reply
  * Request Response - Send single request and expect single reply
  * Request Stream - Send single request and expect stream of responses.
  * Request bidirectional - send stream of requests and expect stream of responses.
* Built-in failure detection, fault tolerance, and elasticity
* Routing and balancing strategies for both stateless and stateful services
* Embeddable into existing applications
* Natural Circuit-Breaker via scalecube-cluster discovery and failure detector.
* Support Service instance tagging.
* Support Service discovery partitioning using hierarchy of namespaces in a multi-cluster deployments.
* Modular, flexible deployment models and topology
* pluggable api-gateway providers (http / websocket / rsocket)
* pluggable service transports (tcp / aeron / rsocket)
* pluggable encoders (json, SBE, Google protocol buffers)
* pluggable service security authentication and authorization providers.

User Guide:

* [Services Overview](http://scalecube.github.io/services.html)
* [Defining Services](http://scalecube.github.io/user-reference/services/DefineService.html)
* [Implementing services](http://scalecube.github.io/user-reference/services/ServiceImplementation.html)
* [Provisioning Clustered Services](http://scalecube.github.io/user-reference/services/ProvisionClusterServices.html)
* [Consuming services](http://scalecube.github.io/user-reference/services/ConsumingServices.html)

Basic Usage:

The example provisions 2 cluster nodes and making a remote interaction.
1. seed is a member node and provision no services of its own.
2. then microservices variable is a member that joins seed member and provision GreetingService instance.
3. finally from seed node - create a proxy by the GreetingService api and send a greeting request.

```java
// service definition
@Service("io.scalecube.Greetings")
public interface GreetingsService {
  @ServiceMethod("sayHello")
	  Mono<Greeting> sayHello(String name);
	}
}
// service implementation
public class GreetingServiceImpl implements GreetingsService {
 @Override
 public Mono<Greeting> sayHello(String name) {
   return Mono.just(new Greeting("Nice to meet you " + name + " and welcome to ScaleCube"));
	}
}

//1. ScaleCube Node node with no members (container 1)
Microservices seed = Microservices.builder()
  .discovery("seed", ScalecubeServiceDiscovery::new)
	.transport(RSocketServiceTransport::new)
	.startAwait();

// get the address of the seed member - will be used to join any other members to the cluster.
final Address seedAddress = seed.discovery("seed").address();

//2. Construct a ScaleCube node which joins the cluster hosting the Greeting Service (container 2)
Microservices serviceNode = Microservices.builder()
  .discovery("seed", ep -> new ScalecubeServiceDiscovery(ep)
		.membership(cfg -> cfg.seedMembers(seedAddress)))
	.transport(RSocketServiceTransport::new)
	.services(new GreetingServiceImpl())
	.startAwait();

//3. Create service proxy (can be created from any node or container in the cluster)
//   and Execute the service and subscribe to incoming service events
seed.call().api(GreetingsService.class)
  .sayHello("joe").subscribe(consumer -> {
    System.out.println(consumer.message());
  });

// await all instances to shutdown.
Mono.whenDelayError(seed.shutdown(), serviceNode.shutdown()).block();
```

Basic Service Example:

* RequestOne: Send single request and expect single reply
* RequestStream: Send single request and expect stream of responses.
* RequestBidirectional: send stream of requests and expect stream of responses.

A service is nothing but an interface declaring what methods we wish to provision at our cluster.

```java

@Service
public interface ExampleService {

  @ServiceMethod
  Mono<String> sayHello(String request);

  @ServiceMethod
  Flux<MyResponse> helloStream();

  @ServiceMethod
  Flux<MyResponse> helloBidirectional(Flux<MyRequest> requests);
}

```

## API-Gateway:

Available api-gateways are [rsocket](/services-gateway-rsocket), [http](/services-gateway-http) and [websocket](/services-gateway-websocket)

Basic API-Gateway example:

```java

    Microservices.builder()
        .discovery(options -> options.seeds(seed.discoveryAddress()))
        .services(...) // OPTIONAL: services (if any) as part of this node.

        // configure list of gateways plugins exposing the apis
        .gateway(options -> new WebsocketGateway(options.id("ws").port(8080)))
        .gateway(options -> new HttpGateway(options.id("http").port(7070)))
        .gateway(options -> new RSocketGateway(options.id("rsws").port(9090)))

        .startAwait();

        // HINT: you can try connect using the api sandbox to these ports to try the api.
        // https://scalecube.github.io/api-sandbox/app/index.html
```

### Maven

With scalecube-services you may plug-and-play alternative providers for Transport,Codecs and discovery.
Scalecube is using ServiceLoader to load providers from class path,

You can think about scalecube as slf4j for microservices - Currently supported SPIs:

**Transport providers:**

* scalecube-services-transport-rsocket: using rsocket to communicate with remote services.

**Message codec providers:**

* scalecube-services-transport-jackson: using Jackson to encode / decode service messages. https://github.com/FasterXML
* scalecube-services-transport-protostuff: using protostuff to encode / decode service messages. https://github.com/protostuff

**Service discovery providers:**

* scalecube-services-discovery: using scalecue-cluster do locate service Endpoint within the cluster
   https://github.com/scalecube/scalecube-cluster

Binaries and dependency information for Maven can be found at http://search.maven.org.

https://mvnrepository.com/artifact/io.scalecube

To add a dependency on ScaleCube Services using Maven, use the following:

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.scalecube/scalecube-services-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.scalecube/scalecube-services-api)

```xml

 <properties>
   <scalecube.version>2.x.x</scalecube.version>
 </properties>

 <!-- -------------------------------------------
   scalecube core and api:
 ------------------------------------------- -->

 <!-- scalecube apis   -->
 <dependency>
  <groupId>io.scalecube</groupId>
  <artifactId>scalecube-services-api</artifactId>
  <version>${scalecube.version}</version>
 </dependency>

 <!-- scalecube services module   -->
 <dependency>
  <groupId>io.scalecube</groupId>
  <artifactId>scalecube-services</artifactId>
  <version>${scalecube.version}</version>
 </dependency>

 <!--

     Plugins / SPIs: bellow a list of providers you may choose from. to constract your own configuration:
     you are welcome to build/contribute your own plugins please consider the existing ones as example.

  -->

 <!-- scalecube transport providers:  -->
 <dependency>
  <groupId>io.scalecube</groupId>
  <artifactId>scalecube-services-transport-rsocket</artifactId>
  <version>${scalecube.version}</version>
 </dependency>
```

----

## Sponsored by:
* [OM2](https://www.om2.com/)
* [exberry.io](https://exberry.io/)

### We Hire at exberry.io
https://exberry.io/career/

### website
https://scalecube.github.io/


# Azure DevOps Plugin for IntelliJ, Android Studio, & other JetBrains IDEs

This is a plugin for working with Git and TFVC repositories on Azure DevOps and Team Foundation Server (TFS) 2015+ inside IntelliJ, Android Studio,
and various other JetBrains IDEs. It is supported on Linux, Mac OS X, and Windows.
It is compatible with IntelliJ IDEA Community and Ultimate editions (version 2021.2.4+) and Android Studio (version 2021.2.1+).

To learn more about installing and using our Azure DevOps IntelliJ plug-in, visit: https://docs.microsoft.com/en-us/azure/devops/repos/git/create-repo-intellij?view=azure-devops

## Pre-Reqs
1. Install OpenJDK 11.
2. Set JAVA_HOME to the location of JDK 11.
3. Clone the repository (if planning on building yourself).

## Building the Plugin

## Build with Gradle
Run the build by:

1. Open a terminal/console window.
2. Navigate to the repository root.
3. Run `./gradlew buildPlugin`
   * If you have multiple versions of the Java JDK installed, you may need to set your `JAVA_HOME` environment variable to the installation folder of the JDK 11.
4. The plugin zip file will be created in the `plugin/build/distributions/` folder.

## Build and Run with IntelliJ
Once you've downloaded the dependencies, run the build by:

1. Start IntelliJ and open the Gradle project from the root project directory.

2. Configure the project to use language level Java 11
   * File -> Project Structure -> Project Settings -> Project
   * Under Project Language Level, select "11 - Local variable syntax for lambda parameters"

3. Configure the project and ***each module*** to build with this "IntelliJ Platform Plugin SDK".
   * File -> Project Structure -> Project Settings -> Project.
     * Under Project SDK, select the entry marked "IntelliJ IDEA <version number>".
   * File -> Project Structure -> Project Settings -> Modules -> Dependencies.
     * For each module beginning with `com.microsoft.alm` (there are three), under Module SDK, select the entry marked "IntelliJ IDEA <version number>".

4. Make sure the 'GUI designer' generates Java source code.
   * File -> Settings (on Windows) / Preferences (on Mac) -> Editor -> GUI Designer -> Generate GUI into -> Select `Java Souce Code`

5. Create a "Plugin" configuration to run/debug the code.
   * Run -> Edit Configurations... -> Add -> Gradle
   * Provide a name for the configuration (e.g., IntelliJ for TFS)
   * Set Gradle project to `azure-devops-intellij`
   * Set Tasks to `:plugin:runIde`

6. Run the plugin by selecting Run -> Run <configuration you used above>.

7. Debug the plugin by selecting Run -> Debug <configuration you used above>.

8. To run tests please check options on the page `Preferences | Build, Execution, Deployment | Build Tools | Gradle | Runner`
    * `Delegate IDE build/run actions to gradle` should checked.
    * In `Run tests using` should select `Gradle Test Runner`

## Contributing

We welcome Pull Requests, please fork this repo and send us your contributions.

Note: This repo is mirrored so any branches created in this repo will be removed.  Please fork.

A few styles we follow:

1. All Java source files must have the following two lines at the top:
    ```
    // Copyright (c) Microsoft. All rights reserved.
    // Licensed under the MIT license. See License.txt in the project root.
    ```
   * Settings -> Editor -> Copyright -> Copyright Profiles -> Create a new "Copyright Profile" with those two lines
   * Assign this profile to the current project

2. No tabs in source code:
   * Settings -> Editor -> Code Style -> Java -> Tabs and Indents -> Uncheck "Use tab character", set "Tab size" and "Indent" to 4

3. No wildcard imports (ex. `java.awt.*`):
   * Settings -> Editor -> Code Style -> Java -> Imports -> Set "Class count to use import with '\*'" and "Names count to use static import with '\*'" to sufficient large numbers such as 100
   * On the same page remove `java.awt.*` and `javax.swing.*` from the "Package to Use Import with '*'" list

Those settings are already configured in the `com.microsoft.alm.plugin.idea.iml` project file we provided.

Gradle build will fail if checkstyle plugin detects a violation.

## Running Integration Tests (L2 tests and reactive client tests)

Our Integration tests are in the L2Tests folder. In order to run them correctly, you have to set up the environment and have an Azure DevOps Services organization setup to run against.

You'll need to add a test project into your account, and add both git and TFVC repositories into it. Git repository should also include a `README.md` file in the repository root, and TFVC repository should include a `readme.txt` file.

Here are the steps to setup your environment:
1. First create run configuration from `L2Tests` gradle project:
   * tasks: `cleanTest test`
   * arguments: `--tests *`
2. Second setup the environment variables that provide the connection information for the tests. If this information is missing the tests will fail with a message that describes the missing information. The values below are examples but you will have to fix them.
   * `MSVSTS_INTELLIJ_RUN_L2_TESTS=true`
   * `MSVSTS_INTELLIJ_TF_EXE=d:\bin\TEE-CLC-14.0.4\tf.cmd`
   * `MSVSTS_INTELLIJ_VSO_GIT_REPO_URL=https://organization.visualstudio.com/projectName/_git/repoName`
   * `MSVSTS_INTELLIJ_VSO_LEGACY_GIT_REPO_URL=https://organization.visualstudio.com/defaultcollection/_git/projectName`
   * `MSVSTS_INTELLIJ_VSO_PASS=PersonalAccessTokenGeneratedFromTheUserSecurityPage`
   * `MSVSTS_INTELLIJ_VSO_SERVER_URL=https://organization.visualstudio.com` (make sure no trailing slash here)
   * `MSVSTS_INTELLIJ_VSO_TEAM_PROJECT=projectName`
   * `MSVSTS_INTELLIJ_VSO_USER=EmailAddressForUser`
   * `MSVSTS_INTELLIJ_UNIQUE_SUFFIX=""`: you may leave it empty; if not empty, it will be used as a suffix for various names in tests; introduced for simultaneous test execution on agents

   _Note_: Do not use https://dev.azure.com/account/ addresses in these environment variables, make sure to use https://account.visualstudio.com/

3. Other things to note:
   * You can toggle whether the tests will run or not simply by changing the MSVSTS_INTELLIJ_RUN_L2_TESTS environment variable.
   * The internal CI build will run these tests

4. To run the reactive client integration tests, create a run configuration for `:client:backend:test` task, or use Gradle to run it. It uses the same environment variables as L2 tests.

## Learn More

Want more information? The following resources are available to help:

* Instructions on how to install the plugin
* End-to-end demo video of the plugin's features
* Documentation and tutorial on how to use the plugin


# Problems for Spring MVC and Spring WebFlux

[![Stability: Sustained](https://masterminds.github.io/stability/sustained.svg)](https://masterminds.github.io/stability/sustained.html)
![Build Status](https://github.com/zalando/problem-spring-web/workflows/build/badge.svg)
[![Coverage Status](https://img.shields.io/coveralls/zalando/problem-spring-web/main.svg)](https://coveralls.io/r/zalando/problem-spring-web)
[![Code Quality](https://img.shields.io/codacy/grade/0236149bf46749b1a582f9fbbde2a4eb/main.svg)](https://www.codacy.com/app/whiskeysierra/problem-spring-web)
[![Release](https://img.shields.io/github/release/zalando/problem-spring-web.svg)](https://github.com/zalando/problem-spring-web/releases)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/zalando/problem-spring-web/main/LICENSE)

*Problem Spring Web* is a set of libraries that makes it easy to produce
[`application/problem+json`](https://datatracker.ietf.org/doc/html/rfc9457) responses from a Spring
application. It fills a niche, in that it connects the [Problem library](https://github.com/zalando/problem) and either
[Spring Web MVC's exception handling](https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc#using-controlleradvice-classes)
or [Spring WebFlux's exception handling](https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#webflux-ann-controller-exceptions)
so that they work seamlessly together, while requiring minimal additional developer effort. In doing so, it aims to
perform a small but repetitive task — once and for all.

The way this library works is based on what we call *advice traits*. An advice trait is a small, reusable
`@ExceptionHandler` implemented as a [default method](https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html)
placed in a single method interface. Those advice traits can be combined freely and don't require to use a common base
class for your [`@ControllerAdvice`](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/ControllerAdvice.html).

:mag_right: Please check out [Baeldung: A Guide to the Problem Spring Web Library](https://www.baeldung.com/problem-spring-web) for a detailed introduction!

## Features

- lets you choose traits *à la carte*
- favors composition over inheritance
- ~20 useful advice traits built in
- Spring MVC and Spring WebFlux support
- Spring Security support
- customizable processing

## Dependencies

- Java 17
- Any build tool using Maven Central, or direct download
- Servlet Container for [problem-spring-web](problem-spring-web) or
- Reactive, non-blocking runtime for [problem-spring-webflux](problem-spring-webflux)
- Spring 6 (or Spring Boot 3) users may use version >= [0.28.0](https://github.com/zalando/problem-spring-web/releases/tag/0.28.0)
- Spring 5 (or Spring Boot 2) users may use version [0.27.0](https://github.com/zalando/problem-spring-web/releases/tag/0.27.0)
- Spring 4 (or Spring Boot 1.5) users may use version [0.23.0](https://github.com/zalando/problem-spring-web/releases/tag/0.23.0)
- Spring Security 5 (optional)
- Failsafe 2.3.3 (optional)

## Installation and Configuration

- [Spring Web MVC](problem-spring-web)
- [Spring WebFlux](problem-spring-webflux)

## Customization

The problem handling process provided by `AdviceTrait` is built in a way that allows for customization whenever the
need arises. All of the following aspects (and more) can be customized by implementing the appropriate advice trait interface:

| Aspect              | Method(s)                   | Default                                                                                |
|---------------------|-----------------------------|-------------------------------------------------------------------------------------------------------|
| Creation            | `AdviceTrait.create(..)`    |                                                                                |
| Logging             | `AdviceTrait.log(..)`       | 4xx as `WARN`, 5xx as `ERROR` including stack trace                                                   |
| Content Negotiation | `AdviceTrait.negotiate(..)` | `application/json`, `application/*+json`, `application/problem+json` and `application/x.problem+json` |
| Fallback            | `AdviceTrait.fallback(..)`  | `application/problem+json`                                                                            |
| Post-Processing     | `AdviceTrait.process(..)`   | n/a                                                                                |

The following example customizes the `MissingServletRequestParameterAdviceTrait` by adding a `parameter` extension field to the `Problem`:

```java
@ControllerAdvice
public class MissingRequestParameterExceptionHandler implements MissingServletRequestParameterAdviceTrait {
    @Override
    public ProblemBuilder prepare(Throwable throwable, StatusType status, URI type) {
        var exception = (MissingServletRequestParameterException) throwable;
        return Problem.builder()
                      .withTitle(status.getReasonPhrase())
                      .withStatus(status)
                      .withDetail(exception.getMessage())
                      .with("parameter", exception.getParameterName());
    }
}
```

## Usage

Assuming there is a controller like this:

```java
@RestController
@RequestMapping("/products")
class ProductsResource {

    @RequestMapping(method = GET, value = "/{productId}", produces = APPLICATION_JSON_VALUE)
    public Product getProduct(String productId) {
        // TODO implement
        return null;
    }

    @RequestMapping(method = PUT, value = "/{productId}", consumes = APPLICATION_JSON_VALUE)
    public Product updateProduct(String productId, Product product) {
        // TODO implement
        throw new UnsupportedOperationException();
    }

}
```

The following HTTP requests will produce the corresponding response respectively:

```http
GET /products/123 HTTP/1.1
Accept: application/xml
```

```http
HTTP/1.1 406 Not Acceptable
Content-Type: application/problem+json

{
  "title": "Not Acceptable",
  "status": 406,
  "detail": "Could not find acceptable representation"
}
```

```http
POST /products/123 HTTP/1.1
Content-Type: application/json

{}
```

```http
HTTP/1.1 405 Method Not Allowed
Allow: GET
Content-Type: application/problem+json

{
  "title": "Method Not Allowed",
  "status": 405,
  "detail": "POST not supported"
}
```

### Stack traces and causal chains

**Before you continue**, please read the section about
[*Stack traces and causal chains*](https://github.com/zalando/problem#stack-traces-and-causal-chains)
in [zalando/problem](https://github.com/zalando/problem).

In case you want to enable stack traces, please configure your `ProblemModule` as follows:

```java
ObjectMapper mapper = new ObjectMapper()
    .registerModule(new ProblemModule().withStackTraces());
```

Causal chains of problems are **disabled by default**, but can be overridden if desired:

```java
@ControllerAdvice
class ExceptionHandling implements ProblemHandling {

    @Override
    public boolean isCausalChainsEnabled() {
        return true;
    }

}
```

**Note** Since you have full access to the application context at that point, you can externalize the
configuration to your `application.yml` and even decide to reuse Spring's `server.error.include-stacktrace` property.

Enabling both features, causal chains and stacktraces, will yield:

```yaml
{
  "title": "Internal Server Error",
  "status": 500,
  "detail": "Illegal State",
  "stacktrace": [
    "org.example.ExampleRestController.newIllegalState(ExampleRestController.java:96)",
    "org.example.ExampleRestController.nestedThrowable(ExampleRestController.java:91)"
  ],
  "cause": {
    "title": "Internal Server Error",
    "status": 500,
    "detail": "Illegal Argument",
    "stacktrace": [
      "org.example.ExampleRestController.newIllegalArgument(ExampleRestController.java:100)",
      "org.example.ExampleRestController.nestedThrowable(ExampleRestController.java:88)"
    ],
    "cause": {
      "title": "Internal Server Error",
      "status": 500,
      "detail": "Null Pointer",
      "stacktrace": [
        "org.example.ExampleRestController.newNullPointer(ExampleRestController.java:104)",
        "org.example.ExampleRestController.nestedThrowable(ExampleRestController.java:86)",
        "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
        "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)",
        "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
        "java.lang.reflect.Method.invoke(Method.java:483)",
        "org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)",
        "org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)",
        "org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)",
        "org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)",
        "org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)",
        "org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)",
        "org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)",
        "org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)",
        "org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)",
        "org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)",
        "org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)",
        "org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)",
        "org.junit.runners.ParentRunner.run(ParentRunner.java:363)",
        "org.junit.runner.JUnitCore.run(JUnitCore.java:137)",
        "com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)",
        "com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)",
        "com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)"
      ]
    }
  }
}
```

## Known Issues

Spring allows to restrict the scope of a `@ControllerAdvice` to a certain subset of controllers:

```java

@ControllerAdvice(assignableTypes = ExampleController.class)
public final class ExceptionHandling implements ProblemHandling
```

By doing this you'll loose the capability to handle certain types of exceptions namely:
- `HttpRequestMethodNotSupportedException`
- `HttpMediaTypeNotAcceptableException`
- `HttpMediaTypeNotSupportedException`
- `NoHandlerFoundException`

We inherit this restriction from Spring and therefore recommend to use an unrestricted `@ControllerAdvice`.

## Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's [Issue Tracker](../../issues).

## Getting Involved/Contributing

To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For
more details, check the [contribution guidelines](.github/CONTRIBUTING.md).

## Credits and references

- [Baeldung: A Guide to the Problem Spring Web Library](https://www.baeldung.com/problem-spring-web)
- [Problem Details for HTTP APIs](http://tools.ietf.org/html/rfc7807)
- [Problem library](https://github.com/zalando/problem)
- [Exception Handling in Spring MVC](https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc#using-controlleradvice-classes)


Google Mobile Ads SDK - Android Mediation
=========================================
The Google Mobile Ads SDK is the latest generation in Google mobile advertising,
and features refined ad formats and streamlined APIs for access to mobile ad
networks and advertising solutions. The SDK enables mobile app developers to
maximize their monetization in native mobile apps.

This repository is broken into two sections:

## Mediation Example

A sample project demonstrating how an ad network can plug into AdMob Mediation.
The project contains a "Sample Ad Network" SDK library, as well as a sample
mediation adapter and custom event implementation for AdMob Mediation capable of
loading banners, interstitials, rewarded video, and native ads.

A test application is also included, and uses the Google Mobile Ads SDK to call
into the adapter and custom event to test their implementations. It can be used
during development to test new adapters and custom events, once ad units have
been set up.

## Mediation Adapters

Open source adapters for mediating via the Google Mobile Ads SDK. A list of
these adapters is available on our
[Mediation](https://developers.google.com/admob/android/mediation#choosing_your_mediation_networks)
page.

## Prebuilt adapters

For prebuilt versions of these adapters, see the
[Google Maven Repository](https://maven.google.com/web/index.html?#com.google.ads.mediation).

## Documentation

Check out our [developer site](https://developers.google.com/admob/android)
for documentation on using the SDK and our
[mediation developer guide](https://developers.google.com/admob/android/mediation-developer)
for information on how to create an adapter.
You can also join the developer community on
[our SDK forum](https://groups.google.com/forum/#!forum/google-admob-ads-sdk).

## Suggesting improvements

For feature requests, or to suggest other improvements, please use
[github's issue tracker](https://github.com/googleads/googleads-mobile-android-mediation/issues).

## License
[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html)


This GitHub project hosts two somewhat distinct projects:
1. AndroidX Test libraries
2. Bazel support for android_instrumentation_test

# AndroidX Test Libraries

The AndroidX Test Library provides an extensive framework for testing Android apps. This library provides a set of APIs that allow you to quickly build and run test code for your apps, including JUnit 4 and functional user interface (UI) tests. You can run tests created using these APIs from the Android Studio IDE or from the command line.

For more details see [developers.android.com/testing](https://developers.android.com/testing)

The following maven libraries are hosted in this repo:

androidx.test:annotation
androidx.test:core
androidx.test.espresso*
androidx.test.ext:junit
androidx.test:orchestrator
androidx.test:runner
androidx.test:rules
androidx.test:services

androidx.test.uiautomator and androidx.test:ext:junit-gtest are hosted on [AOSP](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/README.md)

## Contributing

See [CONTRIBUTING.md](https://github.com/android/android-test/blob/master/CONTRIBUTING.md)

## Issues

We use the
[GitHub issue tracker](https://github.com/android/android-test/issues) for
tracking feature requests and bugs.

Please see the
[AndroidX Test Discuss mailing list](https://groups.google.com/forum/#!forum/androidx-test-discuss)
for general questions and discussion, and please direct specific questions to
[Stack Overflow](https://stackoverflow.com/questions/tagged/androidx-test).

## Releases

https://developer.android.com/jetpack/androidx/releases/test is the canonical source for release notes, and
https://maven.google.com for release artifacts and source snapshots.

# Bazel android_instrumentation_test support

To depend on this repository in Bazel, add the following snippet to your
WORKSPACE file:

```
ATS_TAG = "<release-tag>"
http_archive(
    name = "android_test_support",
    sha256 = "<sha256 of release>",
    strip_prefix = "android-test-%s" % ATS_TAG,
    urls = ["https://github.com/android/android-test/archive/%s.tar.gz" % ATS_TAG],
)
load("@android_test_support//:repo.bzl", "android_test_repositories")
android_test_repositories()
```


# Luna | [![Discord chat](https://img.shields.io/discord/1235328604506685551)](https://discord.gg/bqkGY7cmVX) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/lare96/luna/master/LICENSE.txt)
Luna is a #377 RS2 server designed to be lightweight, fast, and easy to use.

Some of the sweetness within Luna
- high performing and scalable <b>where it matters most</b>
- flexible, event-based Kotlin plugin system for game content
- highly documented
- fully featured

# Getting started
Luna is currently unstable and therefore not ready to be used in a production environment. The first stable pre-release will be [v0.5](https://github.com/luna-rs/luna/milestone/3), which is planned for sometime in July, 2024.

An official client can be found [here](https://gitlab.com/lare96/luna-client), along with the cache. To learn more about how to get started with Luna please visit the [wiki](https://github.com/luna-rs/luna/wiki).

For more help, inquiries, or just to discuss the state of the project please join our [Discord server](https://discord.gg/udCqykV).

# Thanks
- blakeman8192
- Graham


![Logo](https://user-images.githubusercontent.com/4235722/86413251-06fa5300-bcc1-11ea-8f95-0aa92d37595e.png)

     Panda is a clear and stylish programming language for JVM.

     Create clean apps, enhance syntax dynamically or build your own language on top of the Panda Framework.

     ~ panda-lang.org :wq

#### 🗺 Download
Website: [panda-lang.org](https://panda-lang.org/)

Installation: [panda-lang.org/install](https://panda-lang.org/install)

Guide: [panda-lang.org/guide](https://panda-lang.org/guide)

#### 〽 Maven
The latest indev build

```xml
<dependency>
    <groupId>org.panda-lang</groupId>
    <artifactId>panda</artifactId>
    <version>0.5.3-alpha</version>
</dependency>
```

Maven repository: [maven.reposilite.com](https://maven.reposilite.com/#/releases)

```xml
<repository>
    <id>reposilite</id>
    <name>reposilite-repository</name>
    <url>https://maven.reposilite.com/releases</url>
</repository>
```

#### 📜 Repository structure
```
panda/
+--examples/                 Example scripts written in Panda
+--panda/                    Panda module
   +----/src                 All sources of Panda
   +----pom.xml              The main maven build script for Panda module
+--panda-framework/          Panda Framework module
   +----/src                 All sources of Panda Framework
   +----pom.xml              The main maven build script for Panda Framework module
+--panda-utilities/          Panda Utilities module
   +----/src                 All sources of Panda Utilities
   +----pom.xml              The main maven build script for Panda Utilities module
+--pom.xml                   The main maven build script
```

#### 💞 See also
- [Reposilite](https://github.com/panda-lang/reposilite)
- [Light](https://github.com/panda-lang/light)
- [Lily](https://github.com/panda-lang/lily)
- 🥞


# Umple Modelling Language

### Build Status

OS         | Linux Jenkins | Windows Appveyor |
:--------- | ------------- | ---------------- |
**Status** | [![Jenkins Linux Build status](https://jenkins.umple.org/job/Umple/lastSuccessfulBuild/badge/icon?subject=Jenkins%2FLinux&build=lastCompleted:${params.BRANCH=master})](https://jenkins.umple.org/job/Umple/lastSuccessfulBuild?subject=Jenkins%2FLinux&build=lastCompleted:${params.BRANCH=master}) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/1yetvadynui7r8y6?svg=true)](https://ci.appveyor.com/project/vahdat-ab/umple/branch/master)

## Description

This is the main project for various Umple subprojects and components.

Umple is a model-oriented programming technology, allowing developers to embed modelling concepts (e.g. UML associations, state machines), patterns, generation templates, and other abstractions in traditional code, and vice versa. It generates high quality code for Java, C++ and PhP (Python in beta), as well as diagrams, metrics and many other artifacts. It can be embeded in the above languages as well as embed them.

The project homepage is located at https://umple.org/

There are a large number of scientific papers about Umple listed at: https://umple.org/publications

Cite the overall project as: Timothy C. Lethbridge, Andrew Forward, Omar Badreddin, Dusan Brestovansky, Miguel Garzon, Hamoud Aljamaan, Sultan Eid, Ahmed Husseini Orabi, Mahmoud Husseini Orabi, Vahdat Abdelzad, Opeyemi Adesina, Aliaa Alghamdi, Abdulaziz Algablan, Amid Zakariapour,
"Umple: Model-Driven Development for Open Source and Education", _Science of Computer Programming_, 2021, https://doi.org/10.1016/j.scico.2021.102665.

Cite latest software release as: University of Ottawa, Umple, https://umple.org/releases  https://doi.org/10.5281/zenodo.4677562   [![DOI](https://zenodo.org/badge/41397174.svg)](https://zenodo.org/badge/latestdoi/41397174)

## Development Process
Umple is developed in itself, guaranteeing robustness; the most recent version of the compiler must be used to compile itself. See the wiki for development setup: https://umple.org/devsetup

Development follows a model-driven, test-driven, agile, continuous-integration process. Umple is hosted currently on Github at https://umple.org/code . It was first released in 2007. The master was on Google Code from 2011 to mid 2015 and moved to Github in 2015.

Umple has been largely developed as a research project at the University of Ottawa, Canada, by numerous PhD and masters students. Many undergraduates from across Canada and the USA have also contributed through the UCOSP program. See the license file for the list of contributors. https://umple.org/license

## Installation and Downloading

Umple does not need necessarily to be downloaded, the following allow you to run it directly in any web browser:

  * UmpleOnline: https://try.umple.org - Website for the GUI version of Umple
  * Docker: https://umple.org/docker - Install a docker image to run the GUI directly on your local machine

You can download the java jar for command-line use, or the Eclipse plugin:

  * Download page: https://umple.org/dl    - Links to the latest official release and continuous builds (command-line, Eclipse, Docker)

To run locally on your machine, Umple needs Java (versions 8 and up although 17 is recommended) installed. It runs on Mac, Linux and Windows.

## Usage

Umple is a programming and modeling language with a rich syntax. Full documentation with many examples can be found at

  * Umple user manual: https://manual.umple.org

## Other Key links

  * Umple home page: https://www.umple.org  - The main Umple page with a more comprehensive set of links
  * Full documentation of all Umple features with live examples: https://manual.umple.org
  * Live diagram of the metamodel: https://umple.org/metamodel
  * Architecture: https://umple.org/architecture

Umple is continuously tested and built on its own Jenkins server (see https://jenkins.umple.org) . It is also built on Appveyor (https://umple.org/appveyor/).

## Contributing

  * Please report any bugs or improvement requests at: https://umple.org/bugs
  * To set up your development environment please see: https://umple.org/devsetup
  * For more details on contributing, please see: https://github.com/umple/umple/blob/master/CONTRIBUTING.md

## License

Umple is licensed under the MIT license. See https://umple.org/license

## Credits

All developers of Umple are listed in the license file at https://umple.org/license

Financial support has been received from NSERC and the Ontario Research Fund. IBM supported early development of Umple. Google and Facebook supported student travel during Umple's development.

## Contents of the directories

The umple project is split into many smaller subprojects; the folder hierarchy is explained below to better describe the structure.

* build/
  * Ant build scripts and related information including user manual raw data

* cruise.umple/ *Umple compiler*
  * See its own ReadMe.txt for further details
  * See also UmpleTo* below for additional compiler components

* cruise.umple.eclipse/, cruise.umple.xtext.ui/ *Eclipse plugins*

* cruise.umplificator *Converting outside code to Umple*
  * cruise.umple.validator *Validates umple when umplifying*

* cruise.umple.nebula *Infrastructure used for real-time C++*

* dev-tools *Tooling for Umple developers*

* dist *Build produced items, only available after building*
  * libs/ *Managed build dependencies that umple*.jar require to run*
  * cruise.umple/reference *User manual*
  * qa/ *Test reports*
  * umple.jar and umple.VERSION.jar  *Current command-line Compiler*
  * umpledocs.VERSION.jar *User manual generator*
  * umplestats.VERSION.jar *Statistics generation*
  * umplesync.VERSION.jar *UmpleOnline tool to to synchronize graphical form*
  * umplerun.VERSION.jar *tool to drive input to an umple program*
  * vml.VERSION.jar * Extension for variability modeling*
  * umple.unit-test.jar *Test Language Compiler*
  * umple.mutation.jar *Umple Mutant Generator*

* examples/ *Developer curated examples*
* externalexamples/ *External projects that are used for testing*

* ExternalTextEditorPlugins *Plugins for external editors, Notepad++, etc*

* sandbox *Small test done before a build to make sure testing and compiling works*

* testbed/, testbed_php/, testbed_ruby/ *Test suites for Java, Php and Ruby respectively*
* UmpleToJava/ *Code generation for Java*
* UmpleToPhp/ *Code generation for Php*
* UmpleToRuby/ *Code generation for Ruby*
* UmpleToRTCpp/ *Code generation for C++ *
* UmpleToSDL/ *Code generation to convert Umple to SDL* (in early development)
* UmpleToSql/ *Code generation SQL from Umple models*
* UmpleToTest/ *Code generation for abstract tests*
* UmpleToTemplate/ *Location for templates that could be common to subprojects*
* UmpleTToJunit/ *Code Generation for JUnit5 - used by MTL compiler*
* UmpleTToPhpunit/ *Code Generation for PhpUnit - used by MTL compiler*
* UmpleTToRubyunit/ *Code Generation for RubyUnit - used by MTL compiler*
* umpleonline/ *The UmpleOnline web application*
  * UmpleOnline allows generation of code from Umple directly in a web browser, and also editing of Umple both graphically and textually. Available at https://try.umple.org

* Umplificator/ *Reverse engineer code to Umple*
* umplificatoronline/ *Online tool for converting code to Umple*

* umpleUI/ *Projects for the UIGU tooling*
  * Projects for generating a UI through UIGU from Umple. These need work to incorporate them into UmpleOnline

* umplewww/ *Core files from the Umple.org web pages*
  * Includes items such as the user manual that are moved at build time into the appropriate place


# FastLogin

Checks if a Minecraft player has a paid account (premium). If so, they can skip offline authentication (auth plugins).
So they don't need to enter passwords. This is also called auto login (auto-login).

## Features

* Detect paid accounts from others
* Automatically login paid accounts (premium)
* Support various of auth plugins
* Premium UUID support
* Forward skins
* Detect username changed and will update the existing database record
* BungeeCord/Velocity support
* Auto register new premium players
* No client modifications needed
* Good performance by using async operations
* Locale messages
* Support for Bedrock players proxies through FloodGate

## Issues

Please use issues for bug reports, suggestions, questions and more. Please check for existing issues. Existing issues
can be voted up by adding up vote to the original post. Closing issues means that they are marked as resolved. Comments
are still allowed and it could be re-opened.

## Development builds

Development builds contain the latest changes from the Source-Code. They are bleeding edge and could introduce new bugs,
but also include features, enhancements and bug fixes that are not yet in a released version. If you click on the left
side on `Changes`, you can see iterative change sets leading to a specific build.

You can download them from here: https://ci.codemc.org/job/Games647/job/FastLogin/

***

## Commands

    /premium [player] Label the invoker or the argument as paid account
    /cracked [player] Label the invoker or the argument as cracked account

## Permissions

    fastlogin.bukkit.command.premium
    fastlogin.bukkit.command.cracked

    fastlogin.command.premium.other
    fastlogin.command.cracked.other

## Placeholder

This plugin supports `PlaceholderAPI` on `Spigot`. It exports the following variable
`%fastlogin_status%`. In BungeeCord environments, the status of a player will be delivered with a delay after the player
already successful joined the server. This takes about a couple of milliseconds. In this case the value
will be `Unknown`.

Possible values: `Premium`, `Cracked`, `Unknown`

## Requirements

* Java: 21+ recommended for improved multi-threading code by FastLogin
  * Spigot: 8+
  * BungeeCord and Velocity: 17+
* Server software in offlinemode:
  * Spigot (or a fork e.g. Paper) 1.8.8+
    * Protocol plugin:
      * [ProtocolLib 5.2+](https://www.spigotmc.org/resources/protocollib.1997/) or
      * [ProtocolSupport](https://www.spigotmc.org/resources/protocolsupport.7201/)
  * Latest BungeeCord (or a fork e.g. Waterfall) or Velocity proxy
* An auth plugin.

### Supported auth plugins

#### Spigot/Paper

* [AdvancedLogin (Paid)](https://www.spigotmc.org/resources/advancedlogin.10510/)
* [AuthMe (5.X)](https://dev.bukkit.org/bukkit-plugins/authme-reloaded/)
* [CrazyLogin](https://dev.bukkit.org/bukkit-plugins/crazylogin/)
* [LoginSecurity](https://dev.bukkit.org/bukkit-plugins/loginsecurity/)
* [LogIt](https://github.com/games647/LogIt)
* [UltraAuth](https://dev.bukkit.org/bukkit-plugins/ultraauth-aa/)
* [UserLogin](https://www.spigotmc.org/resources/userlogin.80669/)
* [xAuth](https://dev.bukkit.org/bukkit-plugins/xauth/)

#### BungeeCord/Waterfall

* [BungeeAuth](https://www.spigotmc.org/resources/bungeeauth.493/)

## Network requests

This plugin performs network requests to:

* https://api.mojang.com - retrieving uuid data to decide if we should activate premium login
* https://sessionserver.mojang.com - verify if the player is the owner of that account

***

## How to install

### Spigot/Paper

1. Download and install ProtocolLib/ProtocolSupport
2. Download and install `FastLoginBukkit`
3. Set your server in offline mode by setting the value `onlinemode` in your server.properties to `false`

### BungeeCord/Waterfall or Velocity

Install the plugin on both platforms, that is proxy (BungeeCord or Velocity) and backend server (Spigot).

1. Activate proxy support in the server configuration
   * This is often found in `spigot.yml` or `paper.yml`
2. Restart the backend server
3. Now there is `allowed-proxies.txt` file in the FastLogin folder of the restarted server
    * BungeeCord: Put your `stats`-id from the BungeeCord config into this file
    * Velocity: On plugin startup the plugin generates a `proxyId.txt` inside the plugins folder of the proxy
4. Activate ip forwarding in your proxy config
5. Check your database settings in the config of FastLogin on your proxy
    * The proxies only ship with a limited set of drivers where Spigot supports more. Therefore, these are supported:
    * BungeeCord: `mysql` for MySQL/MariaDB
    * Velocity: `mariadb` for MySQL/MariaDB
    * Note the embedded file storage SQLite is not available
    * MySQL/MariaDB requires an external database server running. Check your server provider if there is one available
   or install one.
6. Set proxy and Spigot in offline mode by setting the value `onlinemode` in your `config.yml` to false
7. You should *always* configure the firewall for your Spigot server so that it's only accessible through your proxy
   * This is also the case without this plugin
   * https://www.spigotmc.org/wiki/bungeecord-installation/#post-installation