Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ab481c5
add build.yml
iliyan-velichkov Dec 13, 2023
c71e767
add workflows
iliyan-velichkov Dec 13, 2023
44b83a2
change java from 1.6 to 1.8
iliyan-velichkov Dec 13, 2023
d704ace
build with java 8
iliyan-velichkov Dec 13, 2023
34d3f66
skip tests in workflows
iliyan-velichkov Dec 13, 2023
2c2e272
fix compilation
iliyan-velichkov Dec 13, 2023
78298e8
set version 3.0.0-SNAPSHOT
iliyan-velichkov Dec 13, 2023
6eec1f7
enable tests execution
iliyan-velichkov Dec 13, 2023
54be5ca
add release workflow
iliyan-velichkov Dec 13, 2023
922cc96
update release.yml
iliyan-velichkov Dec 13, 2023
8c3e956
version set to 3.0.1 for release
iliyan-velichkov Dec 13, 2023
43ce118
version set to 3.0.2-SNAPSHOT for development
iliyan-velichkov Dec 13, 2023
61b1ec4
deploy jars
iliyan-velichkov Dec 13, 2023
f17784d
add distributionManagement
iliyan-velichkov Dec 13, 2023
72646b8
change job name
iliyan-velichkov Dec 13, 2023
88b4110
version set to 3.0.2 for release
iliyan-velichkov Dec 13, 2023
e9f4690
version set to 3.0.3-SNAPSHOT for development
iliyan-velichkov Dec 13, 2023
1fafb78
make olingo compatible with Spring Boot 3
iliyan-velichkov Dec 13, 2023
0872ed9
use java 8
iliyan-velichkov Dec 13, 2023
fabbcf6
use java 11
iliyan-velichkov Dec 13, 2023
4bebfe7
use java 17
iliyan-velichkov Dec 13, 2023
77a44e4
javax.ws.rs -> jakarta.ws.rs
iliyan-velichkov Dec 13, 2023
17ce01b
adapt tests
iliyan-velichkov Dec 13, 2023
c028f76
more test adaptations
iliyan-velichkov Dec 13, 2023
45dd462
adapt test
iliyan-velichkov Dec 13, 2023
cac7590
fix docs
iliyan-velichkov Dec 14, 2023
7d55fd1
adapt tests
iliyan-velichkov Dec 14, 2023
5d7914c
more adaptations
iliyan-velichkov Dec 14, 2023
83032e8
adapts tests
iliyan-velichkov Dec 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build
on:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up JDK Corretto
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
architecture: x64
- name: Maven Build
run: mvn clean install

4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8 (Corretto)
- name: Set up JDK (Corretto)
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Build with Maven
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull Request

on:
pull_request:
branches:
- main
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, windows]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up JDK Corretto
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
- name: Maven Build
run: mvn clean install
106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release

on:
workflow_dispatch:
inputs:
releaseVersion:
description: Release Version
required: true
default: 3.0.0
snapshotVersion:
description: Snapshot Version
required: true
default: 3.0.1-SNAPSHOT

run-name: 'version set to ${{ github.event.inputs.releaseVersion }} for release'

jobs:
release-project:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

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

- name: Set up JDK Corretto
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
architecture: x64

- name: "Configure Git"
run: |
git fetch
git checkout ${{ github.event.inputs.branch }}
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

- name: "Maven: Set Release Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }}

- name: Setup Maven settings.xml
uses: whelk-io/maven-settings-xml-action@v11
with:
servers:
'[
{
"id": "github",
"username": "${env.GITHUB_USERNAME}",
"password": "${env.GITHUB_TOKEN}"
}
]'

- name: Build Project
run: mvn clean install

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
BUILD_ENV: 'github-actions'

- name: "Git: Commit Release Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.releaseVersion }} for release"

- name: "Maven: Set Snapshot Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.snapshotVersion }}

- name: "Git: Commit Snapshot Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.snapshotVersion }} for development"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.event.inputs.releaseVersion }}
release_name: Release ${{ github.event.inputs.releaseVersion }}
body: |
Changes in this Release:
- First Change
- Second Change
draft: false
prerelease: false

- name: "Git: Push Changes"
run: |
git checkout -B ${{ github.event.inputs.releaseVersion }}
git push --set-upstream origin ${{ github.event.inputs.releaseVersion }}
git checkout -B master
git push --set-upstream origin master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ classes
.DS_Store
nb-configuration.xml
context.xml
*.versionsBackup
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-annotation-processor</artifactId>
<version>2.0.13</version>
<version>3.0.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-annotation-processor</artifactId>
<version>2.0.13</version>
<version>3.0.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down
4 changes: 1 addition & 3 deletions odata2-annotation-processor/annotation-processor-ref/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.olingo</groupId>
<artifactId>olingo-odata2-annotation-processor</artifactId>
<version>2.0.13</version>
<version>3.0.3-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

Expand Down Expand Up @@ -90,7 +90,6 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
Expand All @@ -102,7 +101,6 @@
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
/*******************************************************************************
* 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
*
* 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.
*
* 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.
******************************************************************************/
package org.apache.olingo.odata2.annotation.processor.ref.model;

Expand All @@ -23,74 +19,76 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.imageio.ImageIO;

/**
*
*/
public class ResourceHelper {

public static byte[] loadAsByte(final String resource) {
return load(resource, new byte[0]);
}

public static byte[] load(final String resource, final byte[] defaultResult) {
InputStream instream = null;
try {
instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
if (instream == null) {
return defaultResult;
}
ByteArrayOutputStream stream = new ByteArrayOutputStream();
int b = 0;
while ((b = instream.read()) != -1) {
stream.write(b);
}
public static byte[] loadAsByte(final String resource) {
return load(resource, new byte[0]);
}

return stream.toByteArray();
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
if (instream != null) {
public static byte[] load(final String resource, final byte[] defaultResult) {
InputStream instream = null;
try {
instream.close();
} catch (IOException ex) {}
}
instream = Thread.currentThread()
.getContextClassLoader()
.getResourceAsStream(resource);
if (instream == null) {
return defaultResult;
}
ByteArrayOutputStream stream = new ByteArrayOutputStream();
int b = 0;
while ((b = instream.read()) != -1) {
stream.write(b);
}

return stream.toByteArray();
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
if (instream != null) {
try {
instream.close();
} catch (IOException ex) {
}
}
}
}

public enum Format {
BMP, JPEG, PNG, GIF
}
}

public enum Format {
BMP, JPEG, PNG, GIF
};
public static byte[] generateImage() {
return generateImage(Format.PNG);
}

public static byte[] generateImage() {
return generateImage(Format.PNG);
}
public static byte[] generateImage(final Format format) {
try {
int width = 320;
int height = 320;
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
WritableRaster raster = image.getRaster();

public static byte[] generateImage(final Format format) {
try {
int width = 320;
int height = 320;
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
WritableRaster raster = image.getRaster();
int mod = format.ordinal() + 2;
for (int h = 0; h < height; h++) {
for (int w = 0; w < width; w++) {
if (((h / 32) + (w / 32)) % mod == 0) {
raster.setSample(w, h, 0, 0);
} else {
raster.setSample(w, h, 0, 1);
}
}
}

int mod = format.ordinal() + 2;
for (int h = 0; h < height; h++) {
for (int w = 0; w < width; w++) {
if (((h / 32) + (w / 32)) % mod == 0) {
raster.setSample(w, h, 0, 0);
} else {
raster.setSample(w, h, 0, 1);
}
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
ImageIO.write(image, format.name(), out);
return out.toByteArray();
} catch (IOException ex) {
return new byte[0];
}
}

ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
ImageIO.write(image, format.name(), out);
return out.toByteArray();
} catch (IOException ex) {
return new byte[0];
}
}
}
Loading