Skip to content

Commit

Permalink
Merge pull request #88 from brenoepics/main
Browse files Browse the repository at this point in the history
up
  • Loading branch information
brenoepics authored May 1, 2024
2 parents 77217c8 + 8ff73cb commit e0324e8
Show file tree
Hide file tree
Showing 34 changed files with 497 additions and 53,871 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/greetings.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Release With Maven
run: |
mvn -s settings.xml -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} --batch-mode deploy -DskipTests
mvn -s settings.xml -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} --batch-mode deploy -DskipTests -P publish
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
45 changes: 0 additions & 45 deletions .github/workflows/qodana.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .licrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[licenses]
accepted = ["Apache-2.0", "MIT", "MSC", "BSD"]

[dependencies]
ignored=["ignored_dep1", "ignored_dep2"]
ignore_dev_dependencies = true
ignore_optional_dependencies = true

[behavior]
run_only_on_dependency_modification = true
do_not_block_pr = false
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,8 @@ libraryDependencies += "io.github.brenoepics" % "at4j" % "1.0.0"

**A:** You can access your Azure Translator Keys through your Azure portal. Remember to keep your keys secure and refrain from sharing them publicly. If you suspect a key has been compromised, it's crucial to regenerate it promptly. For detailed instructions on generating your own keys, refer to [this guide](https://brenoepics.github.io/at4j/guide/azure-subscription.html#azure-subscription). Additionally, you can explore the [Azure Free Tier](https://brenoepics.github.io/at4j/guide/azure-subscription.html#azure-free-tier) for more information.

Optional Logger Dependency
**Q:** Is there a recommended logger dependency for the project?

**A:** While our project is compatible with any Log4j-2-compatible logging framework, integrating one can enhance your logging experience significantly. This allows you to configure log format, log targets (console, file, database, etc.), log levels per class, and more. For further details, please visit our [Docs](https://brenoepics.github.io/at4j/guide/installation.html#logger-dependency).

## 🤝 Thank You!
- **Microsoft Azure**: Supporting our project with a generous grant of $10,000+ in Azure credits, enabling us to utilize virtual machines, document translation and other essential cloud resources for our development needs.
- **Microsoft Azure**: Supporting our project with a generous grant of $10,000+ in Azure credits, enabling us to use virtual machines, document translation and other essential cloud resources for our development needs.
- We extend our sincere thanks to all contributors for their invaluable contributions.

## 🧑‍💻 Contributing
Expand Down
34 changes: 19 additions & 15 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { defineConfigWithTheme } from 'vitepress'
import type { ThemeConfig } from 'vitepress-carbon'
import {defineConfigWithTheme} from 'vitepress'
import type {ThemeConfig} from 'vitepress-carbon'
import baseConfig from 'vitepress-carbon/config'

const nav = [
{
text: 'Docs',
activeMatch: `^/(guide|examples)/`,
items: [
{ text: 'Guide', link: '/guide/introduction' },
{ text: 'Examples', link: '/examples/' },
{ text: 'Error Reference', link: '/error-reference/' },
{ text: 'JavaDoc', link: 'https://brenoepics.github.io/at4j/javadoc/' }
{text: 'Guide', link: '/guide/introduction'},
{text: 'Examples', link: '/examples/'},
{text: 'Error Reference', link: '/error-reference/'},
{text: 'JavaDoc', link: 'https://brenoepics.github.io/at4j/javadoc/'}
]
},
{
text: 'About',
activeMatch: `^/about/`,
items: [
{ text: 'FAQ', link: '/about/faq' },
{ text: 'Releases', link: '/about/releases' },
{ text: 'Code of Conduct', link: '/about/coc' }
{text: 'FAQ', link: '/about/faq'},
{text: 'Releases', link: '/about/releases'},
{text: 'Code of Conduct', link: '/about/coc'}
]
},
]
Expand All @@ -28,7 +28,7 @@ const sidebar = {
{
text: 'Getting Started',
items: [
{ text: 'Introduction', link: '/guide/introduction' },
{text: 'Introduction', link: '/guide/introduction'},
{
text: 'Download/Installation',
link: '/guide/installation'
Expand All @@ -41,6 +41,10 @@ const sidebar = {
text: 'Basic Usage',
link: '/guide/basic-usage'
},
{
text: 'Threading',
link: '/guide/threading'
},
{
text: 'Examples',
link: '/examples/'
Expand Down Expand Up @@ -79,10 +83,10 @@ export default defineConfigWithTheme<ThemeConfig>({
base: '/at4j/',

head: [
['meta', { name: 'theme-color', content: '#3c8772' }],
['meta', { property: 'og:url', content: 'https://github.com/brenoepics/at4j' }],
['meta', { property: 'og:type', content: 'Repository' }],
['meta', { property: 'og:title', content: 'AT4J' }],
['meta', {name: 'theme-color', content: '#3c8772'}],
['meta', {property: 'og:url', content: 'https://github.com/brenoepics/at4j'}],
['meta', {property: 'og:type', content: 'Repository'}],
['meta', {property: 'og:title', content: 'AT4J'}],
[
'meta',
{
Expand All @@ -109,7 +113,7 @@ export default defineConfigWithTheme<ThemeConfig>({
},
link: 'https://www.postman.com/maintenance-astronaut-2993290/workspace/brenoepics/collection/18589822-dfe7a640-9b94-47a8-b19f-46cb9cc8843e?action=share&creator=18589822'
},
{ icon: 'github', link: 'https://github.com/brenoepics/at4j' }
{icon: 'github', link: 'https://github.com/brenoepics/at4j'}

],

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"preview": "vitepress preview"
},
"dependencies": {
"vitepress-carbon": "1.0.2"
"vitepress-carbon": "latest"
}
}
3 changes: 2 additions & 1 deletion docs/src/error-reference/ErrorsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ defineProps<{

<template>
<table>
<caption>Error Codes</caption>
<thead>
<tr>
<th>Code</th>
Expand All @@ -28,7 +29,7 @@ defineProps<{

<style scoped>
.highlight {
color: var(--vp-c-yellow-soft);
color: var(--vp-c-brand-1);
font-weight: bold;
}
</style>
1 change: 1 addition & 0 deletions docs/src/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ public class ExampleDetector {
}
}
```

47 changes: 0 additions & 47 deletions docs/src/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,50 +25,3 @@ implementation group: 'io.github.brenoepics', name: 'at4j', version: 'AT4J-VERSI
libraryDependencies += "io.github.brenoepics" % "at4j" % "AT4J-VERSION"
```
:::

## Optional Logger Dependency {#logger-dependency}

In addition to AT4J, it is also recommended to install a Log4j-2-compatible logging framework.
A logging framework can be used to provide a more sophisticated logging experience with being able to configure log format,
log targets (console, file, database, Discord direct message, ...), log levels per class, and much more.

For example, Log4j Core:

::: code-group
```groovy [Gradle]
dependencies { runtimeOnly 'org.apache.logging.log4j:log4j-core:2.17.0' }
```

```xml [Maven]
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.0</version>
</dependency>
```

```scala [Sbt]
libraryDependencies ++= Seq("org.apache.logging.log4j" % "log4j-core" % "2.17.0")
```
:::

Or Log4j to Slf4j:

::: code-group
```groovy [Gradle]
dependencies { runtimeOnly 'org.apache.logging.log4j:log4j-to-slf4j:2.22.1' }
```

```xml [Maven]
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.22.1</version>
</dependency>
```
```scala [Sbt]
libraryDependencies ++= Seq("org.apache.logging.log4j" % "log4j-to-slf4j" % "2.22.1")
```
:::

Take a look at the logger configuration doc for further information.
31 changes: 31 additions & 0 deletions docs/src/guide/threading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Creating an AzureApi with a Custom ExecutorService

This guide will walk you through the process of creating an `AzureApiBuilder` with a custom `ExecutorService`.

## Steps

1. **Create a custom ExecutorService**

For this example, we'll create a custom `ExecutorService` using the Virtual Threads API introduced in Java 21:

```java
ExecutorService customExecutorService = Executors.newVirtualThreadPerTaskExecutor();
```

2. **Create an AzureApiBuilder**

You can create an `AzureApi` by using the `AzureApiBuilder` class. Here's an example:

```java
String azureKey = "<Your Azure Subscription Key>";
String azureRegion = "<Your Azure Subscription Region>";

AzureApi azureApi = new AzureApiBuilder()
.setKey(azureKey)
.region(azureRegion)
.executorService(customExecutorService).build();
```
This will create an `AzureApi` with the settings you specified in the `AzureApiBuilder`.

That's it! You've successfully created an `AzureApi` with a custom `ExecutorService`. You can now use this `AzureApi` to
make requests to the Azure API.
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.brenoepics</groupId>
<artifactId>at4j</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>

<name>Azure Translator For Java</name>
<description>
Expand All @@ -23,7 +23,7 @@
<developers>
<developer>
<name>Breno Andrade</name>
<email>ibreno076@gmail.com</email>
<email>git@breno.tech</email>
</developer>
</developers>
<scm>
Expand Down Expand Up @@ -52,14 +52,14 @@
</properties>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.23.0</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.16.1</version>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -69,7 +69,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.10.0</version>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -93,7 +93,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>default-jar</id>
Expand All @@ -107,7 +107,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<version>3.2.4</version>
<configuration>
<skip>true</skip>
</configuration>
Expand Down Expand Up @@ -148,7 +148,7 @@
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.3.1</version>
<version>0.4.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
Expand All @@ -158,7 +158,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -177,7 +177,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down
Loading

0 comments on commit e0324e8

Please sign in to comment.