Skip to content

Commit

Permalink
Merge 2ab9f7c into 8b4f9ce
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallpierce committed Jun 20, 2019
2 parents 8b4f9ce + 2ab9f7c commit 5d50313
Show file tree
Hide file tree
Showing 304 changed files with 712 additions and 931 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.setting/
bin/
target/

*/build
*/out
/.gradle

# OS X
.DS_Store
Expand All @@ -24,3 +26,4 @@ pom.xml.releaseBackup
pom.xml.next
pom.xml.tag

*.bin
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,33 @@ jdk:


############
# We still support and test jdk8 for clients, but on travis we no longer build with jkd8, see
# We still support and test jdk8 for clients, but on travis we no longer build with jkd8, see
# https://github.com/RoaringBitmap/RoaringBitmap/pull/290 for rationale.
##########
# we removed oraclejdk7 as per https://github.com/RoaringBitmap/RoaringBitmap/pull/176#issuecomment-322257170
#########

# from https://docs.travis-ci.com/user/languages/java/#caching
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

# Install silently to ensure all pom are installed and compilation is OK: actual checks will be processed by script:
install: "mvn -P ci clean install --quiet -DskipTests -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -Dgpg.skip=true"
# Including testClasses so tests will compile too.
install: "./gradlew assemble testClasses"

branches:
only:
- master

script:
- mvn javadoc:javadoc
- mvn checkstyle:check
- mvn test jacoco:report -Dgpg.skip=true -DBITMAP_TYPES=ROARING_ONLY
# run checkstyle, etc, without the tests to fail fast
- ./gradlew check -x test
- ./gradlew test jacocoTestReport -DBITMAP_TYPES=ROARING_ONLY

after_success:
- mvn coveralls:report
- ./gradlew coveralls
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class Basic {
}
```

Please see the examples folder for more examples.
Please see the examples folder for more examples, which you can run with `./gradlew :examples:runAll`, or run a specific one with `./gradlew :examples:runExampleBitmap64`, etc.


Unsigned integers
Expand Down Expand Up @@ -440,11 +440,11 @@ Benchmark

To run JMH benchmarks, use the following command:

$ ./jmh/run.sh
$ ./gradlew jmh

You can also run specific benchmarks...

$ ./jmh/run.sh org.roaringbitmap.aggregation.and.identical.*
$ ./jmh/run.sh 'org.roaringbitmap.aggregation.and.identical.*'


Mailing list/discussion group
Expand Down
10 changes: 10 additions & 0 deletions RoaringBitmap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
val deps: Map<String, String> by extra

dependencies {
implementation(project(":shims"))

testImplementation("junit:junit:${deps["junit"]}")
testImplementation("com.google.guava:guava:${deps["guava"]}")
testImplementation("org.apache.commons:commons-lang3:${deps["commons-lang"]}")
testImplementation("com.esotericsoftware:kryo:5.0.0-RC1")
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.roaringbitmap;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

Expand All @@ -11,7 +13,6 @@
import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;

import static java.nio.channels.FileChannel.MapMode.READ_WRITE;
Expand All @@ -24,20 +25,19 @@
@RunWith(Parameterized.class)
public class TestSerializationViaByteBuffer {

private static Path dir;
private Path dir;

@BeforeClass
public static void setup() throws IOException {
dir = Paths.get(System.getProperty("user.dir")).resolve("target").resolve(UUID.randomUUID().toString());
Files.createDirectory(dir);
@Rule
public final TemporaryFolder tf = new TemporaryFolder();

@Before
public void setUp() throws IOException {
dir = tf.newFolder().toPath();
}

@AfterClass
public static void cleanup() throws IOException {
public static void cleanup() {
System.gc();
try {
Files.walkFileTree(dir, new DirectoryCleanup());
} catch (IOException e) { }
}

@Parameterized.Parameters(name = "{1}/{0} keys/runOptimise={2}")
Expand Down Expand Up @@ -200,4 +200,4 @@ public void testSerializeToByteBufferDeserializeByteBuffer() throws IOException
roundtrip.deserialize(buffer);
assertEquals(input, roundtrip);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package org.roaringbitmap.buffer;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.roaringbitmap.DirectoryCleanup;
import org.roaringbitmap.SeededTestData;

import java.io.*;
Expand All @@ -14,7 +15,6 @@
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;

import static java.nio.channels.FileChannel.MapMode.READ_WRITE;
Expand All @@ -24,20 +24,19 @@
@RunWith(Parameterized.class)
public class TestSerializationViaByteBuffer {

private static Path dir;
private Path dir;

@BeforeClass
public static void setup() throws IOException {
dir = Paths.get(System.getProperty("user.dir")).resolve("target").resolve(UUID.randomUUID().toString());
Files.createDirectory(dir);
@Rule
public final TemporaryFolder tf = new TemporaryFolder();

@Before
public void setUp() throws IOException {
dir = tf.newFolder().toPath();
}

@AfterClass
public static void cleanup() throws IOException {
public static void cleanup() {
System.gc();
try {
Files.walkFileTree(dir, new DirectoryCleanup());
} catch (IOException e) { }
}

@Parameterized.Parameters(name = "{1}/{0} keys/runOptimise={2}")
Expand Down
168 changes: 168 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
import com.jfrog.bintray.gradle.BintrayExtension

plugins {
id("net.researchgate.release") version "2.8.0"
id("com.jfrog.bintray") version "1.8.4" apply false
id("com.github.kt3k.coveralls") version "2.8.4" apply false
}

// some parts of the Kotlin DSL don't work inside a `subprojects` block yet, so we do them the old way
// (without typesafe accessors)

subprojects {
// used in per-subproject dependencies
@Suppress("UNUSED_VARIABLE") val deps by extra {
mapOf(
"junit" to "4.12",
"guava" to "20.0",
"commons-lang" to "3.4"
)
}

apply(plugin = "java-library")
apply(plugin = "jacoco")
apply(plugin = "com.github.kt3k.coveralls")

repositories {
jcenter()
}

tasks.withType<JavaCompile> {
options.isDeprecation = true
options.isWarnings = true
}

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = "org.roaringbitmap"
}

tasks.named<JacocoReport>("jacocoTestReport") {
reports {
// used by coveralls
xml.isEnabled = true
}
}
}

subprojects.filter { !listOf("jmh", "fuzz-tests", "examples", "simplebenchmark").contains(it.name) }.forEach {
it.run {
apply(plugin = "checkstyle")

tasks.withType<Checkstyle> {
configFile = File(rootProject.projectDir, "RoaringBitmap/style/roaring_google_checks.xml")
isIgnoreFailures = false
isShowViolations = true
}

// don't checkstyle source
tasks.named<Checkstyle>("checkstyleTest") {
exclude("**/**")
}
}
}

subprojects.filter { listOf("RoaringBitmap", "shims").contains(it.name) }.forEach { project ->
project.run {
apply(plugin = "maven-publish")
apply(plugin = "com.jfrog.bintray")

tasks {
register<Jar>("sourceJar") {
from(project.the<SourceSetContainer>()["main"].allJava)
archiveClassifier.set("sources")
}

register<Jar>("docJar") {
from(project.tasks["javadoc"])
archiveClassifier.set("javadoc")
}
}

configure<PublishingExtension>() {
publications {
register<MavenPublication>("bintray") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()

from(components["java"])
artifact(tasks["sourceJar"])
artifact(tasks["docJar"])

// requirements for maven central
// https://central.sonatype.org/pages/requirements.html
pom {
name.set("${project.group}:${project.name}")
description.set("Roaring bitmaps are compressed bitmaps (also called bitsets) which tend to outperform conventional compressed bitmaps such as WAH or Concise.")
url.set("https://github.com/RoaringBitmap/RoaringBitmap")
issueManagement {
system.set("GitHub Issue Tracking")
url.set("https://github.com/RoaringBitmap/RoaringBitmap/issues")
}
licenses {
license {
name.set("Apache 2")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("lemire")
name.set("Daniel Lemire")
email.set("lemire@gmail.com")
url.set("http://lemire.me/en/")
roles.addAll("architect", "developer", "maintainer")
timezone.set("-5")
properties.put("picUrl", "http://lemire.me/fr/images/JPG/profile2011B_152.jpg")
}
}
scm {
connection.set("scm:git:https://github.com/RoaringBitmap/RoaringBitmap.git")
developerConnection.set("scm:git:https://github.com/RoaringBitmap/RoaringBitmap.git")
url.set("https://github.com/RoaringBitmap/RoaringBitmap")
}
}
}
}
}

configure<BintrayExtension> {
user = rootProject.findProperty("bintrayUser")?.toString()
key = rootProject.findProperty("bintrayApiKey")?.toString()
setPublications("bintray")

with(pkg) {
repo = "maven"
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/RoaringBitmap/RoaringBitmap"
// use "bintray package per artifact" to match the auto-gen'd pkg structure inherited from
// Maven Central's artifacts
name = "org.roaringbitmap:${project.name}"
userOrg = "roaringbitmap"

with(version) {
name = project.version.toString()
released = java.util.Date().toString()
vcsTag = "RoaringBitmap-${project.version}"
}
}
}
}
}

tasks {
create("build") {
// dummy build task to appease release plugin
}
}

release {
tagTemplate = "RoaringBitmap-\$version"
}

tasks.afterReleaseBuild {
dependsOn(tasks.named("bintrayUpload"))
}
11 changes: 11 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
From the root dir, run:

```
./gradlew :examples:runAll
```

Or see tasks to run each one individually:

```
./gradlew :examples:tasks --all
```
18 changes: 18 additions & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dependencies {
implementation(project(":RoaringBitmap"))
}

tasks {
val runAll by registering {}

File(project.projectDir, "src/main/java").list().forEach {
val className = it.replace(".java", "")
val childTask = project.tasks.create("runExample$className", JavaExec::class) {
main = className
classpath = sourceSets.main.get().runtimeClasspath
dependsOn(compileJava)
}

runAll.get().dependsOn(childTask)
}
}

0 comments on commit 5d50313

Please sign in to comment.