Skip to content

Commit

Permalink
update naming and groupid
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity committed Dec 19, 2024
1 parent 4683e22 commit 149a750
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 52 deletions.
2 changes: 1 addition & 1 deletion eng/versioning/external_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ com.squareup.okhttp3:okhttp;4.12.0
com.squareup:javapoet;1.13.0
commons-codec:commons-codec;1.15
commons-net:commons-net;3.9.0
io.clientcore.tools:sdk-codegen-tool;1.0.0-beta.1
io.clientcore.tools:annotation-processor;1.0.0-beta.1
io.cloudevents:cloudevents-api;2.2.0
io.cloudevents:cloudevents-core;2.2.0
io.fabric8:kubernetes-client;6.12.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codegen Compile time generator Plugin
# Client Core Compile-Time Annotation Processor

A Java annotation processor for generating HTTP service implementations based on annotated interfaces.
The client-core annotation processor for introducing compile-time code generation for libraries based on client core

## Usage

Expand All @@ -9,8 +9,8 @@ A Java annotation processor for generating HTTP service implementations based on
<dependencies>
<dependency>
<groupId>io.clientcore.tools</groupId>
<artifactId>sdk-codegen-tool</artifactId>
<version>1.0.0.beta.1</version> <!-- {x-version-update;io.clientcore.tools:sdk-codegen-tool;external_dependency} -->
<artifactId>annotation-processor</artifactId>
<version>1.0.0.beta.1</version> <!-- {x-version-update;io.clientcore.tools:annotation-processor;external_dependency} -->
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -56,12 +56,12 @@ A Java annotation processor for generating HTTP service implementations based on

private final String endpoint;

private final OpenAIServiceVersion serviceVersion;
private final ExampleServiceVersion serviceVersion;

private String apiVersion;

public OpenAIClientServiceImpl(HttpPipeline defaultPipeline, ObjectSerializer serializer,
String endpoint, OpenAIServiceVersion serviceVersion) {
public ExampleServiceImpl (HttpPipeline defaultPipeline, ObjectSerializer serializer,
String endpoint, ExampleServiceVersion serviceVersion) {
this.defaultPipeline = defaultPipeline;
this.serializer = serializer;
this.endpoint = endpoint;
Expand All @@ -77,7 +77,7 @@ A Java annotation processor for generating HTTP service implementations based on
return defaultPipeline;
}

public OpenAIServiceVersion getServiceVersion() {
public ExampleServiceVersion getServiceVersion() {
return serviceVersion;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<modelVersion>4.0.0</modelVersion>

<groupId>io.clientcore.tools</groupId>
<artifactId>sdk-codegen-tool</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;io.clientcore.tools:sdk-codegen-tool;external_dependency} -->
<artifactId>annotation-processor</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;io.clientcore.tools:annotation-processor;external_dependency} -->

<name>Clientcore codegen tool</name>
<description>A Java annotation processor tool for generating HTTP service implementations</description>
<name>Client Core Compile-Time Annotation Processor</name>
<description>The client-core annotation processor for introducing compile-time code generation for libraries based on client core</description>

<distributionManagement>
<snapshotRepository>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package io.generation.tools.codegen;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import io.generation.tools.codegen.models.HttpRequestContext;
import io.generation.tools.codegen.models.Substitution;
import io.generation.tools.codegen.models.TemplateInput;
import io.generation.tools.codegen.templating.TemplateProcessor;
import io.generation.tools.codegen.utils.PathBuilder;
package io.clientcore.tools.codegen;

import io.clientcore.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.Substitution;
import io.clientcore.tools.codegen.models.TemplateInput;
import io.clientcore.tools.codegen.templating.TemplateProcessor;
import io.clientcore.tools.codegen.utils.PathBuilder;
import io.clientcore.core.annotation.ServiceInterface;
import io.clientcore.core.http.annotation.BodyParam;
import io.clientcore.core.http.annotation.HeaderParam;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package io.generation.tools.codegen.exceptions;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.tools.codegen.exceptions;

/**
* Exception thrown when a substitution is missing from the template.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package io.generation.tools.codegen.models;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.tools.codegen.models;

import io.clientcore.core.http.models.HttpMethod;

Expand Down Expand Up @@ -33,7 +36,7 @@ public final class HttpRequestContext {
private final Map<String, String> headers;
private final Map<String, String> queryParams;

private final Map<String, io.generation.tools.codegen.models.Substitution> substitutions;
private final Map<String, Substitution> substitutions;

private int[] expectedStatusCodes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package io.generation.tools.codegen.models;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.tools.codegen.models;

/**
* A Substitution is a value that can be used to replace placeholder values in a URL. Placeholders look like:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package io.generation.tools.codegen.models;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.tools.codegen.models;

import io.clientcore.core.http.annotation.UnexpectedResponseExceptionDetail;
import javax.lang.model.element.TypeElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package io.generation.tools.codegen.templating;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import io.generation.tools.codegen.models.HttpRequestContext;
import io.generation.tools.codegen.models.TemplateInput;
import io.generation.tools.codegen.utils.ResponseBodyModeGeneration;
package io.clientcore.tools.codegen.templating;

import io.clientcore.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.TemplateInput;
import io.clientcore.tools.codegen.utils.ResponseBodyModeGeneration;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package io.generation.tools.codegen.templating;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import io.generation.tools.codegen.models.TemplateInput;
package io.clientcore.tools.codegen.templating;

import io.clientcore.tools.codegen.models.TemplateInput;

import javax.annotation.processing.ProcessingEnvironment;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package io.generation.tools.codegen.utils;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import io.generation.tools.codegen.exceptions.MissingSubstitutionException;
import io.generation.tools.codegen.models.HttpRequestContext;
import io.generation.tools.codegen.models.Substitution;
package io.clientcore.tools.codegen.utils;

import io.clientcore.tools.codegen.exceptions.MissingSubstitutionException;
import io.clientcore.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.Substitution;

import java.util.Map;
import java.util.regex.Matcher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package io.generation.tools.codegen.utils;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.clientcore.tools.codegen.utils;

import com.squareup.javapoet.MethodSpec;
import io.clientcore.core.http.models.HttpResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.clientcore.tools.codegen.AnnotationProcessor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.models;
package io.clientcore.tools.codegen.models;

import io.clientcore.core.http.annotation.UnexpectedResponseExceptionDetail;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.templating;
package io.clientcore.tools.codegen.templating;

import io.generation.tools.codegen.models.HttpRequestContext;
import io.generation.tools.codegen.models.Substitution;
import io.generation.tools.codegen.models.TemplateInput;
import io.clientcore.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.Substitution;
import io.clientcore.tools.codegen.models.TemplateInput;
import com.squareup.javapoet.MethodSpec;
import io.clientcore.core.http.models.HttpMethod;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.templating;
package io.clientcore.tools.codegen.templating;

import io.generation.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.HttpRequestContext;
import com.squareup.javapoet.MethodSpec;
import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeEach;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.templating;
package io.clientcore.tools.codegen.templating;

import io.generation.tools.codegen.models.TemplateInput;
import io.clientcore.tools.codegen.models.TemplateInput;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.utils;
package io.clientcore.tools.codegen.utils;

import io.generation.tools.codegen.exceptions.MissingSubstitutionException;
import io.generation.tools.codegen.models.HttpRequestContext;
import io.generation.tools.codegen.models.Substitution;
import io.clientcore.tools.codegen.exceptions.MissingSubstitutionException;
import io.clientcore.tools.codegen.models.HttpRequestContext;
import io.clientcore.tools.codegen.models.Substitution;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package io.generation.tools.codegen.utils;
package io.clientcore.tools.codegen.utils;

import com.squareup.javapoet.MethodSpec;
import org.junit.jupiter.api.BeforeEach;
Expand Down
4 changes: 2 additions & 2 deletions sdk/clientcore/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.clientcore</groupId>
<artifactId>clientcore-tools-service</artifactId>
<artifactId>clientcore-tools-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0</version> <!-- Need not change for every release-->
<modules>
<module>sdk-codegen-tool</module>
<module>annotation-processor</module>
</modules>
</project>

This file was deleted.

0 comments on commit 149a750

Please sign in to comment.