Skip to content

Commit

Permalink
Merge d958474 into 58e1efe
Browse files Browse the repository at this point in the history
  • Loading branch information
davecromberge committed Jun 22, 2021
2 parents 58e1efe + d958474 commit 393fe57
Show file tree
Hide file tree
Showing 152 changed files with 2,556 additions and 217 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/.toolchains.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@
<toolchain>
<type>jdk</type>
<provides>
<version>8</version>
<vendor>adoptopenjdk</vendor>
<version>1.8</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${JAVA_HOME}</jdkHome>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>11</version>
<vendor>adoptopenjdk</vendor>
<version>8</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA11_HOME}</jdkHome>
<jdkHome>${env.JAVA8_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>15</version>
<vendor>adoptopenjdk</vendor>
<version>9</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA15_HOME}</jdkHome>
<jdkHome>${env.JAVA9_HOME}</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>16</version>
<vendor>adoptopenjdk</vendor>
<version>11</version>
<vendor>openjdk</vendor>
</provides>
<configuration>
<jdkHome>${env.JAVA16_HOME}</jdkHome>
<jdkHome>${env.JAVA11_HOME}</jdkHome>
</configuration>
</toolchain>
</toolchains>
137 changes: 90 additions & 47 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,97 @@
name: Java Test Coverage with Maven, Coveralls

on:
pull_request:
push:
branches: [ master ]
workflow_dispatch:
pull_request:
push:
branches: [ master ]
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx4g -Xms1g
repo_token: ${{secrets.coveralls_token}}
MAVEN_OPTS: -Xmx4g -Xms1g
repo_token: ${{secrets.coveralls_token}}
RUNNER_TEMP: /tmp

jobs:
build:
name: Build, Test, Coverage
runs-on: ubuntu-latest

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install JDK
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
impl: hotspot
targets: 'JDK_8;JAVA_HOME'

- name: Install Dependencies
run: >
mvn clean install -B -V -q
-DskipTests=true
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Test & Report
if: ${{ success() }}
run: >
mvn verify coveralls:report -B -V -q
-Dcoveralls-repo-token=${repo_token}
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
build:
name: Build, Test, Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: [8,9,11]

env:
JDK_VERSION: ${{ matrix.jdk }}

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install JDK 8
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
architecture: x64
impl: hotspot
targets: 'JAVA8_HOME'

- name: Install JDK 9
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '9'
architecture: x64
impl: hotspot
targets: 'JAVA9_HOME'

- name: Install JDK 11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
architecture: x64
impl: hotspot
targets: 'JAVA11_HOME'

- name: Install Matrix JDK
uses: AdoptOpenJDK/install-jdk@v1
with:
version: ${{ matrix.jdk }}
architecture: x64
impl: hotspot
targets: 'JAVA_HOME'

- name: Echo Java Version
run: >
java -version
- name: Install Dependencies
run: >
mvn clean install
-DskipTests=true
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Package
run: >
mvn package
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
- name: Test & Report
if: ${{ matrix.jdk == 8 && success() }}
run: >
mvn verify coveralls:report -B -V
-Dcoveralls-repo-token=${repo_token}
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
--toolchains .github/workflows/.toolchains.xml
60 changes: 60 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
##########################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
##########################################################################################

#########################################################################################
# Use the extraction block to define changes to the default code extraction process #
# for one or more languages. The settings for each language are defined in a child #
# block, with one or more steps. #
#########################################################################################

extraction:

# Define settings for Java analysis
####################################
java:
# The `index` step extracts information from the files in the codebase.
index:
# Specify the Java version required to build the project.
java_version: 8
# Specify Maven settings.
maven:
# Specify the path of a Maven toolchains file.
# Default: Maven uses a toolchains file in the default location, if it exists.
toolchains_file: .github/workflows/.toolchains.xml

# Define settings for JavaScript analysis
##########################################
javascript:

# The `index` step extracts information from the files in the codebase.
index:
# Specify a list of files and folders to exclude from extraction.
exclude:
- **/*/site
# Specify a list of glob patterns to include/exclude files from extraction; this
# is applied on top of the include/exclude paths from above; patterns are
# processed in the same way as for path classifiers above.
# Default: include all files with known extensions (such as .js, .ts and .html),
# but exclude files ending in `-min.js` or `.min.js` and folders named `node_modules`
# or `bower_components`
filters:
# exclude any *.js files anywhere.
- exclude: "**/*.js"
# exclude any *.html files anywhere.
- exclude: "**/*.html"
70 changes: 64 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,49 @@ Please visit the main [DataSketches website](https://datasketches.apache.org) fo

If you are interested in making contributions to this site please see our [Community](https://datasketches.apache.org/docs/Community/) page for how to contact us.

---

## Java Support

Datasketches memory currently supports Java 8 up to and including Java 13.

In order to use the library in Java 9 and above, you must provide the following runtime arguments to the JVM:

```shell
--add-opens java.base/java.nio=org.apache.datasketches.memory \
--add-opens java.base/jdk.internal.misc=org.apache.datasketches.memory \
--add-opens java.base/jdk.internal.ref=org.apache.datasketches.memory
```

For example, to run your local application with full compatibility for the Java module system, you might use the following command:
```shell
$JAVA \
--module-path mods \
--add-opens java.base/java.nio=org.apache.datasketches.memory \
--add-opens java.base/jdk.internal.misc=org.apache.datasketches.memory \
--add-opens java.base/jdk.internal.ref=org.apache.datasketches.memory \
--module my.main.application.module
```

where `mods` is your module path and `my.main.application.module` is your own JPMS module:

```java
module datasketches.memory.multirelease.test {
requires org.apache.datasketches.memory;
}
```


---

## Build Instructions
__NOTE:__ This component accesses resource files for testing. As a result, the directory elements of the full absolute path of the target installation directory must qualify as Java identifiers. In other words, the directory elements must not have any space characters (or non-Java identifier characters) in any of the path elements. This is required by the Oracle Java Specification in order to ensure location-independent access to resources: [See Oracle Location-Independent Access to Resources](https://docs.oracle.com/javase/8/docs/technotes/guides/lang/resources.html)

### JDK8/Hotspot is required to compile
This DataSketches component is pure Java and you must compile using JDK 8 with Hotspot.
### JDK versions required to compile
This DataSketches component is pure Java and requires the following JDKs to compile:
- JDK8/Hotspot
- JDK9/Hotspot
- JDK11/Hotspot

### Recommended Build Tool
This DataSketches component is structured as a Maven project and Maven is the recommended Build Tool.
Expand All @@ -69,12 +105,34 @@ This will create the following Jars:
* datasketches-memory-X.Y.Z-test-sources.jar The test source files
* datasketches-memory-X.Y.Z-javadoc.jar The compressed Javadocs.

### Dependencies
### Toolchains

This project makes use of Maven toolchains to ensure that the correct Java compiler version is used when compiling source files.

#### Run-time
There is one run-time dependency:
The reference toolchains.xml can be found in .github/workflows/.toolchains.xml, and can be copied to your local maven home
directory e.g. `~/.m2/toolchains.xml`.

* org.slf4j:slf4j-api
Alternatively, the maven commands above can be supplemented with: `--toolchains .github/workflows/.toolchains.xml`

For example, to run normal unit tests:

$ mvn clean test --toolchains .github/workflows/.toolchains.xml

### Dependencies

There are no run-time dependencies.

#### Testing
See the pom.xml file for test dependencies.

---

## Further documentation for contributors

For more information on the project configuration, the following topics are discussed in more detail:

* [Maven configuration](docs/maven.md)
* [Multi-release jar](docs/multi-release-jar.md)
* [Java Platform Module System](docs/module-system.md)

In order to build and contribute to this project, please read the [development setup documentation](docs/development.md).
43 changes: 43 additions & 0 deletions datasketches-memory-java11/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory-root</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>datasketches-memory-java11</artifactId>
<name>${project.artifactId}</name>

<properties>
<maven.install.skip>true</maven.install.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<java.version>11</java.version>
<jdk-toolchain.version>11</jdk-toolchain.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

</project>

0 comments on commit 393fe57

Please sign in to comment.