Skip to content

Commit 65a4aa2

Browse files
Update README.md
1 parent 94de4bf commit 65a4aa2

File tree

1 file changed

+5
-112
lines changed

1 file changed

+5
-112
lines changed

README.md

+5-112
Original file line numberDiff line numberDiff line change
@@ -8,139 +8,32 @@ Java 1.8 or later
88

99
## Installation
1010

11-
### Authentication
12-
13-
To authenticate with the Github package repository, you will need to generate a [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). This should have at least `read:packages` scope. Please keep the token safe for the next stage of the setup procedure.
14-
1511
### Gradle users
1612

17-
Using the Personal Access Token generated earlier, you will need to [setup Gradle](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry) to use this token.
18-
19-
To do so you will need to create a `gradle.properties` file to include your personal access token. Create a new `gradle.properties` file in your repository and replace `GITHUB_USERNAME` and `GITHUB_TOKEN` with your username and your previously generated token.
20-
21-
```yaml
22-
gpr.user=<GITHUB_USERNAME>
23-
gpr.key=<GITHUB_TOKEN>
24-
```
25-
26-
Once this is done, add your dependency to your project's build.gradle file:
13+
To add the SDK as a dependency, please add the following to your project's `build.gradle` file:
2714

2815
```gradle
2916
dependencies {
30-
implementation 'com.anduril:anduril-sdk-java:+'
17+
implementation 'com.anduril:anduril-sdk-java:1.0.2'
3118
}
3219
33-
repositories {
34-
maven {
35-
url = uri('https://maven.pkg.github.com/anduril/anduril-java')
36-
credentials {
37-
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
38-
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
39-
}
40-
}
41-
}
4220
```
4321

4422
### Maven users
4523

46-
Using the Personal Access Token generated earlier, you will need to [setup Maven](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-with-a-personal-access-token) to use this token.
47-
48-
To do so you will need to edit your ~/.m2/settings.xml file to include your personal access token. Create a new ~/.m2/settings.xml file if one doesn't exist. Be sure to replace `GITHUB_USERNAME` and `GITHUB_TOKEN` with your username and your previously generated token.
49-
50-
```xml
51-
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
52-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
53-
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
54-
http://maven.apache.org/xsd/settings-1.0.0.xsd">
55-
56-
<activeProfiles>
57-
<activeProfile>github</activeProfile>
58-
</activeProfiles>
59-
60-
<profiles>
61-
<profile>
62-
<id>github</id>
63-
<repositories>
64-
<repository>
65-
<id>central</id>
66-
<url>https://repo1.maven.org/maven2</url>
67-
</repository>
68-
<repository>
69-
<id>github</id>
70-
<url>https://maven.pkg.github.com/anduril/anduril-java)</url>
71-
<snapshots>
72-
<enabled>true</enabled>
73-
</snapshots>
74-
</repository>
75-
</repositories>
76-
</profile>
77-
</profiles>
78-
79-
<servers>
80-
<server>
81-
<id>github</id>
82-
<username>GITHUB_USERNAME</username>
83-
<password>GITHUB_TOKEN</password>
84-
</server>
85-
</servers>
86-
</settings>
87-
```
88-
89-
Once this is done, add your dependency to your project's POM. To get the latest version, please visit the Github [package](https://github.com/anduril/anduril-java/packages/2221565).
24+
To add the SDK as a dependency, please add the following to your project's `pom.xml` file:
9025

9126
```xml
9227
<dependency>
9328
<groupId>com.anduril</groupId>
9429
<artifactId>anduril-sdk-java</artifactId>
95-
<version>1.0.0-SNAPSHOT20</version>
30+
<version>1.0.2</version>
9631
</dependency>
9732
```
9833

9934
## Usage
10035

101-
AndurilExample.java
102-
103-
```java
104-
105-
package com.demo;
106-
107-
import java.util.logging.Level;
108-
import java.util.logging.Logger;
109-
110-
import com.anduril.entitymanager.v1.EntityManagerAPIGrpc;
111-
import com.anduril.entitymanager.v1.EntityManagerAPIGrpc.EntityManagerAPIBlockingStub;
112-
import com.anduril.entitymanager.v1.GetEntityRequest;
113-
114-
import io.grpc.ClientInterceptor;
115-
import io.grpc.ManagedChannel;
116-
import io.grpc.ManagedChannelBuilder;
117-
import io.grpc.Metadata;
118-
import io.grpc.Status;
119-
import io.grpc.stub.MetadataUtils;
120-
121-
class AndurilExample {
122-
public static void main(String[] args) {
123-
ManagedChannel channel = ManagedChannelBuilder.forAddress("desert-guardian.anduril.com", 443).useTransportSecurity().build();
124-
125-
Metadata header = new Metadata();
126-
Metadata.Key<String> key = Metadata.Key.of("authorization", Metadata.ASCII_STRING_MARSHALLER);
127-
// REPLACE BEARER TOKEN
128-
header.put(key, "Bearer <BEARER TOKEN");
129-
130-
// apply interceptor to apply auth headers to requests
131-
ClientInterceptor interceptor = MetadataUtils.newAttachHeadersInterceptor(header);
132-
EntityManagerAPIBlockingStub serviceStub = EntityManagerAPIGrpc.newBlockingStub(channel).withInterceptors(interceptor);
133-
134-
GetEntityRequest request = GetEntityRequest.newBuilder().setEntityId("ABC").build();
135-
try {
136-
serviceStub.getEntity(request);
137-
} catch (Exception e) {
138-
Status status = Status.fromThrowable(e);
139-
Logger.getGlobal().log(Level.INFO, status.getDescription());
140-
}
141-
}
142-
}
143-
```
36+
Please visit our [docs site](https://docs.anduril.com).
14437

14538
## Support
14639

0 commit comments

Comments
 (0)