Skip to content

Commit

Permalink
chore: Build java on Travis and add README (box/box-codegen#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build committed Sep 27, 2024
1 parent 9528060 commit f3cd222
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "5a78cc2", "specHash": "6b64d06", "version": "0.1.0" }
{ "engineHash": "1a0f05b", "specHash": "6b64d06", "version": "0.1.0" }
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: SDK documentation
url: https://github.com/box/box-java-sdk-gen/tree/main/docs
about: Before creating an issue, I have checked that the SDK documentation doesn't solve my issue.
- name: API documentation
url: https://developer.box.com/docs
about: Before creating an issue, I have checked that the API documentation doesn't solve my issue.
- name: Box Developer Forums
url: https://community.box.com/t5/Platform-and-Development-Forum/bd-p/DeveloperForum
about: Before creating an issue, I have searched the Box Developer Forums and my issue isn't already reported there.
- name: Issues in this repo
url: https://github.com/box/box-java-sdk-gen/search?type=Issues
about: Before creating an issue, I have searched Issues in this repo and my issue isn't already reported.
39 changes: 39 additions & 0 deletions .github/workflows/autoupdate-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Autoupdate PR
on:
push:
branches:
- main

jobs:
update_pull_requests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: $

- name: Set up Git
run: |
git config --global user.name 'box-sdk-build'
git config --global user.email 'box-sdk-build@box.com'
- name: Fetch all branches and tags
run: git fetch --prune --unshallow

- name: Auto update pull requests
run: |
PR_LIST=$(curl -s -H "Authorization: Bearer $" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" | jq -r '.[] | .head.ref')
for pr_branch in $PR_LIST; do
git checkout "$pr_branch"
if git merge origin/main; then
git push
else
# Conflict occurred, resolve by keeping our changes
git checkout --ours .
git add .
git commit -m "Auto resolve conflict by keeping our changes"
git push
fi
done
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
distribution: ['zulu', 'temurin']
java: ['8', '11', '17']
name: Java ${{ matrix.java }} (${{ matrix.distribution }})
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Build and test
run: ./gradlew check --stacktrace
21 changes: 21 additions & 0 deletions .github/workflows/spell-check-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: spell-check-lint
on:
pull_request_target:
types: [opened, synchronize, edited]
branches:
- main
jobs:
spellcheck-request-title:
runs-on: ubuntu-latest
steps:
- name: Checkout current repository
uses: actions/checkout@v2
- name: Checkout spellchecker
uses: actions/checkout@v2
with:
ref: refs/heads/main
repository: box/box-sdk-spellchecker
token: $
path: spellchecker
- name: Execute spellchecker
uses: ./spellchecker
87 changes: 87 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<p align="center">
<img src="https://github.com/box/sdks/blob/master/images/box-dev-logo.png" alt= “box-dev-logo” width="30%" height="50%">
</p>

# Box Java SDK GENERATED

We are excited to introduce the Early Access Release of the latest generation of Box Java SDK, designed to elevate the developer experience and streamline your integration with the Box Content Cloud.

With this SDK, you’ll have access to:

1. Full API Support: The new generation of Box SDKs empowers developers with complete coverage of the Box API ecosystem. You can now access all the latest features and functionalities offered by Box, allowing you to build even more sophisticated and feature-rich applications.
2. Rapid API Updates: Say goodbye to waiting for new Box APIs to be incorporated into the SDK. With our new auto-generation development approach, we can now add new Box APIs to the SDK at a much faster pace (in a matter of days). This means you can leverage the most up-to-date features in your applications without delay.
3. Embedded Documentation: We understand that easy access to information is crucial for developers. With our new approach, we have included comprehensive documentation for all objects and parameters directly in the source code of the SDK. This means you no longer need to look up this information on the developer portal, saving you time and streamlining your development process.
4. Enhanced Convenience Methods: Our commitment to enhancing your development experience continues with the introduction of convenience methods. These methods cover various aspects such as chunk uploads, classification, and much more.
5. Seamless Start: The new SDKs integrate essential functionalities like authentication, automatic retries with exponential backoff, exception handling, request cancellation, and type checking, enabling you to focus solely on your application's business logic.

Embrace the new generation of Box SDKs and unlock the full potential of the Box Content Cloud.

# Table of contents

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installing](#installing)
- [Getting Started](#getting-started)
- [Documentation](#documentation)
- [Questions, Bugs, and Feature Requests?](#questions-bugs-and-feature-requests)
- [Copyright and License](#copyright-and-license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installing

To generate a .jar file download the source code and run the following command:

```console
./gradlew build
```

.jar file will be generated in the build/libs directory.

Unfortunately, .jar file is not yet available in any artifactory. It will be available there when SDK reaches beta phase.

# Getting Started

To get started with the SDK, get a Developer Token from the Configuration page of your app in the [Box Developer
Console](https://app.box.com/developers/console). You can use this token to make test calls for your own Box account.

The SDK provides an `BoxDeveloperTokenAuth` class, which allows you to authenticate using your Developer Token.
Use instance of `BoxDeveloperTokenAuth` to initialize `BoxClient` object.
Using `BoxClient` object you can access managers, which allow you to perform some operations on your Box account.

The example below demonstrates how to authenticate with Developer Token and print names of all items inside a root folder.

```java
BoxDeveloperTokenAuth auth = new BoxDeveloperTokenAuth("DEVELOPER_TOKEN");
BoxClient client = new BoxClient(auth);
```

# Documentation

Browse the [docs](docs/README.md) or see [API Reference](https://developer.box.com/reference/) for more information.

# Questions, Bugs, and Feature Requests?

Need to contact us directly? [Browse the issues
tickets](https://github.com/box/box-java-sdk-gen/issues)! Or, if that
doesn't work, [file a new
one](https://github.com/box/box-java-sdk-gen/issues/new) and we will get
back to you. If you have general questions about the Box API, you can
post to the [Box Developer Forum](https://forum.box.com/).

# Copyright and License

Copyright 2023 Box, Inc. All rights reserved.

Licensed 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.

0 comments on commit f3cd222

Please sign in to comment.