Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clients): generate common LICENSE #3258

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions clients/algoliasearch-client-dart/packages/client_core/LICENSE

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions config/generation.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,6 @@ export const patterns = [
'tests/output/swift/Package.swift',
'!tests/output/swift/handwritten/**',
'!tests/output/swift/Utils/**',

'clients/**/LICENSE'
];
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("globaljson.mustache", "../", "global.json"));
supportingFiles.add(new SupportingFile("netcore_project.mustache", "Algolia.Search.csproj"));
supportingFiles.add(new SupportingFile("Configuration.mustache", "Clients", packageName + "Configuration.cs"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
}

/** Escape <> in generic with {} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void processOpts() {
supportingFiles.removeIf(file -> file.getTemplateFile().contains("README"));

supportingFiles.add(new SupportingFile("version.mustache", srcFolder, "version.dart"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

// Search config
additionalProperties.put("isSearchClient", client.equals("search"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void processOpts() {
supportingFiles.clear();
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
supportingFiles.add(new SupportingFile("client.mustache", "", "client.go"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

try {
additionalProperties.put("packageVersion", Helpers.getClientConfigField("go", "packageVersion"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("build_config.mustache", invokerFolder, "BuildConfig.java"));
supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));
additionalProperties.put("isSearchClient", client.equals("search"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

try {
additionalProperties.put("packageVersion", Helpers.getClientConfigField("java", "packageVersion"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void processOpts() {
// root export files
supportingFiles.add(new SupportingFile("index.mustache", "", "index.js"));
supportingFiles.add(new SupportingFile("index.d.mustache", "", "index.d.ts"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

// `client` related files, `algoliasearch` have it's own logic below
if (!isAlgoliasearchClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("ApiClient.kt.mustache", apiFolder, "ApiClient.kt"));
supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));
supportingFiles.add(new SupportingFile("README_BOM.mustache", "client-bom", "README.md"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

additionalProperties.put("packageVersion", Helpers.getClientConfigField("kotlin", "packageVersion"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("client_config.mustache", "lib/Configuration", getClientName(client) + "Config.php"));
supportingFiles.add(new SupportingFile("Algolia.mustache", "lib", "Algolia.php"));

supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

additionalProperties.put("isSearchClient", client.equals("search"));
additionalProperties.put("configClassname", getClientName(client) + "Config");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("__init__.mustache", packageName + "/models", "__init__.py"));
supportingFiles.add(new SupportingFile("__init__.mustache", "http", "__init__.py"));
supportingFiles.add(new SupportingFile("config.mustache", packageName, "config.py"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public void processOpts() {
apiTestTemplateFiles.clear();
modelTestTemplateFiles.clear();

supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));

// Remove some files we don't want to output or change their paths
supportingFiles.removeIf(file ->
file.getTemplateFile().equals("gitignore.mustache") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void processOpts() {
var modelFolder = sourceFolder + File.separator + modelPackage.replace(".", File.separator);
supportingFiles.add(new SupportingFile("version.mustache", "", "version.sbt"));
supportingFiles.add(new SupportingFile("jsonSupport.mustache", modelFolder, "JsonSupport.scala"));
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
additionalProperties.put("isSearchClient", client.equals("search"));
typeMapping.put("AnyType", "Any");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void processOpts() {
supportingFiles.add(
new SupportingFile("client_configuration.mustache", sourceFolder, getClientName(CLIENT) + "ClientConfiguration.swift")
);
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
supportingFiles.add(new SupportingFile("Package.mustache", "Package.swift"));
supportingFiles.add(new SupportingFile("podspec.mustache", projectName + ".podspec"));
supportingFiles.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
1 change: 1 addition & 0 deletions templates/csharp/LICENSE
1 change: 1 addition & 0 deletions templates/dart/LICENSE
1 change: 1 addition & 0 deletions templates/go/LICENSE
1 change: 1 addition & 0 deletions templates/java/LICENSE
1 change: 1 addition & 0 deletions templates/javascript/clients/LICENSE
1 change: 1 addition & 0 deletions templates/kotlin/LICENSE
1 change: 1 addition & 0 deletions templates/php/LICENSE
1 change: 1 addition & 0 deletions templates/python/LICENSE
1 change: 1 addition & 0 deletions templates/ruby/LICENSE
1 change: 1 addition & 0 deletions templates/scala/LICENSE
1 change: 1 addition & 0 deletions templates/swift/LICENSE
Loading