Skip to content

Commit

Permalink
Merge pull request #87 from contentstack/next
Browse files Browse the repository at this point in the history
Utils SDK Updated
  • Loading branch information
ishaileshmishra authored Aug 18, 2023
2 parents 93705b9 + b65ae3e commit c2f8afd
Show file tree
Hide file tree
Showing 21 changed files with 278 additions and 307 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/github-package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publishing to GitHub Packages
#on: [ push ] # Trigger the workflow when a push (commit) event occurs
on:
release:
types: [ created ]
jobs:
publish-github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: github
- name: Publish to GitHub Packages
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 0 additions & 37 deletions .github/workflows/maven-publish.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/sast-scan.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/secrets-scan.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# CHANGELOG

## v1.12.2

### Date: 08-AUG-2023

- Updated Utils SDK to v1.2.3

## v1.12.1

### Date: 07-Jun-2023

- Added Support For Nested Assets
- General Code Improvement

## v1.12.0

### Date: 25-APR-2023
Expand Down
89 changes: 67 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.contentstack.sdk</groupId>
<artifactId>java</artifactId>
<version>1.12.1-SNAPSHOT</version>
<version>1.12.2</version>
<packaging>jar</packaging>
<name>contentstack-java</name>
<description>Java SDK for Contentstack Content Delivery API</description>
Expand All @@ -22,7 +22,6 @@
<dotenv-source.version>3.0.0</dotenv-source.version>
<rxjava-source.version>3.1.6</rxjava-source.version>
<retrofit-source.version>2.9.0</retrofit-source.version>
<converter-gson-source.version>2.9.0</converter-gson-source.version>
<loggin.version>4.11.0</loggin.version>
<jococo-plugin.version>0.8.5</jococo-plugin.version>
<lombok-source.version>1.18.28</lombok-source.version>
Expand All @@ -37,7 +36,7 @@
<json-version>20230227</json-version>
<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
<maven-release-plugin-version>2.5.3</maven-release-plugin-version>
<contentstack-utils-version>1.2.2</contentstack-utils-version>
<contentstack-utils-version>1.2.3</contentstack-utils-version>
</properties>

<parent>
Expand Down Expand Up @@ -87,14 +86,25 @@
</developers>

<distributionManagement>

<!-- Maven Snapshot Repository -->
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

<!--GitHub Packages-->
<!-- <repository>-->
<!-- <id>github</id>-->
<!-- <url>https://maven.pkg.github.com/contentstack/contentstack-java</url>-->
<!-- </repository>-->

<!-- Maven Release Repository-->
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>

</distributionManagement>


Expand All @@ -105,36 +115,41 @@
<version>${contentstack-utils-version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${json-version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>${dotenv-source.version}</version>
<scope>runtime</scope>
<!-- <scope>runtime</scope>-->
</dependency>

<dependency>
<groupId>io.reactivex.rxjava3</groupId>
<artifactId>rxjava</artifactId>
<version>${rxjava-source.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>${retrofit-source.version}</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-gson -->
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>${converter-gson-source.version}</version>
<scope>compile</scope>
<version>${retrofit-source.version}</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
Expand Down Expand Up @@ -171,6 +186,36 @@
</dependencies>


<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<!--
Expand Down Expand Up @@ -233,20 +278,20 @@
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
<!-- <version>1.6</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>sign-artifacts</id>-->
<!-- <phase>verify</phase>-->
<!-- <goals>-->
<!-- <goal>sign</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -268,8 +313,8 @@
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<serverId>github</serverId>
<nexusUrl>https://maven.pkg.github.com/contentstack/contentstack-java</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
Expand Down
57 changes: 25 additions & 32 deletions src/main/java/com/contentstack/sdk/Asset.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ protected void setStackInstance(@NotNull Stack stack) {
/**
* Configure asset.
*
* @param jsonObject
* the json object
* @param jsonObject the json object
* @return the asset
*/
public Asset configure(JSONObject jsonObject) {
Expand All @@ -77,19 +76,17 @@ public Asset configure(JSONObject jsonObject) {
/**
* Sets header.
*
* @param headerKey
* the header key
* @param headerValue
* the header value
*
* <br>
* <br>
* <b>Example :</b><br>
* <p>
* <code>
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
* stack.asset(asset_uid); asset.setHeader();
* </code>
* @param headerKey the header key
* @param headerValue the header value
*
* <br>
* <br>
* <b>Example :</b><br>
* <p>
* <code>
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
* stack.asset(asset_uid); asset.setHeader();
* </code>
*/
public void setHeader(@NotNull String headerKey, @NotNull String headerValue) {
headers.put(headerKey, headerValue);
Expand All @@ -98,17 +95,16 @@ public void setHeader(@NotNull String headerKey, @NotNull String headerValue) {
/**
* Remove header.
*
* @param headerKey
* the header key
*
* <br>
* <br>
* <b>Example :</b>
* <p>
* <code>
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
* stack.asset(asset_uid); asset.removeHeader();
* <code>
* @param headerKey the header key
*
* <br>
* <br>
* <b>Example :</b>
* <p>
* <code>
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
* stack.asset(asset_uid); asset.removeHeader();
* <code>
*/
public void removeHeader(@NotNull String headerKey) {
headers.remove(headerKey);
Expand Down Expand Up @@ -457,10 +453,8 @@ public Asset includeDimension() {
/**
* Add param asset.
*
* @param paramKey
* the param key
* @param paramValue
* the param value
* @param paramKey the param key
* @param paramValue the param value
* @return the asset
*
* <br>
Expand Down Expand Up @@ -538,8 +532,7 @@ public Asset includeMetadata() {
/**
* Fetch.
*
* @param callback
* the callback
* @param callback the callback
*/
public void fetch(FetchResultCallback callback) {
urlQueries.put(ENVIRONMENT, this.headers.get(ENVIRONMENT));
Expand Down
Loading

0 comments on commit c2f8afd

Please sign in to comment.