Skip to content

Commit e5cfcf0

Browse files
authored
feat(clients): generate common LICENSE (#3258)
1 parent c07eab7 commit e5cfcf0

File tree

27 files changed

+27
-64
lines changed

27 files changed

+27
-64
lines changed

clients/algoliasearch-client-dart/packages/client_core/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

clients/algoliasearch-client-dart/packages/client_insights/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

clients/algoliasearch-client-dart/packages/client_recommend/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

config/generation.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,6 @@ export const patterns = [
159159
'tests/output/swift/Package.swift',
160160
'!tests/output/swift/handwritten/**',
161161
'!tests/output/swift/Utils/**',
162+
163+
'clients/**/LICENSE'
162164
];

generators/src/main/java/com/algolia/codegen/AlgoliaCSharpGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void processOpts() {
122122
supportingFiles.add(new SupportingFile("globaljson.mustache", "../", "global.json"));
123123
supportingFiles.add(new SupportingFile("netcore_project.mustache", "Algolia.Search.csproj"));
124124
supportingFiles.add(new SupportingFile("Configuration.mustache", "Clients", packageName + "Configuration.cs"));
125+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
125126
}
126127

127128
/** Escape <> in generic with {} */

generators/src/main/java/com/algolia/codegen/AlgoliaDartGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public void processOpts() {
9999
supportingFiles.removeIf(file -> file.getTemplateFile().contains("README"));
100100

101101
supportingFiles.add(new SupportingFile("version.mustache", srcFolder, "version.dart"));
102+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
102103

103104
// Search config
104105
additionalProperties.put("isSearchClient", client.equals("search"));

generators/src/main/java/com/algolia/codegen/AlgoliaGoGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public void processOpts() {
5252
supportingFiles.clear();
5353
supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.go"));
5454
supportingFiles.add(new SupportingFile("client.mustache", "", "client.go"));
55+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
5556

5657
try {
5758
additionalProperties.put("packageVersion", Helpers.getClientConfigField("go", "packageVersion"));

generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public void processOpts() {
5555
supportingFiles.add(new SupportingFile("build_config.mustache", invokerFolder, "BuildConfig.java"));
5656
supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));
5757
additionalProperties.put("isSearchClient", client.equals("search"));
58+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
5859

5960
try {
6061
additionalProperties.put("packageVersion", Helpers.getClientConfigField("java", "packageVersion"));

generators/src/main/java/com/algolia/codegen/AlgoliaJavascriptGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public void processOpts() {
5858
// root export files
5959
supportingFiles.add(new SupportingFile("index.mustache", "", "index.js"));
6060
supportingFiles.add(new SupportingFile("index.d.mustache", "", "index.d.ts"));
61+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
6162

6263
// `client` related files, `algoliasearch` have it's own logic below
6364
if (!isAlgoliasearchClient) {

generators/src/main/java/com/algolia/codegen/AlgoliaKotlinGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public void processOpts() {
112112
supportingFiles.add(new SupportingFile("ApiClient.kt.mustache", apiFolder, "ApiClient.kt"));
113113
supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties"));
114114
supportingFiles.add(new SupportingFile("README_BOM.mustache", "client-bom", "README.md"));
115+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
115116

116117
additionalProperties.put("packageVersion", Helpers.getClientConfigField("kotlin", "packageVersion"));
117118
}

generators/src/main/java/com/algolia/codegen/AlgoliaPhpGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public void processOpts() {
5050
supportingFiles.add(new SupportingFile("client_config.mustache", "lib/Configuration", getClientName(client) + "Config.php"));
5151
supportingFiles.add(new SupportingFile("Algolia.mustache", "lib", "Algolia.php"));
5252

53+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
54+
5355
additionalProperties.put("isSearchClient", client.equals("search"));
5456
additionalProperties.put("configClassname", getClientName(client) + "Config");
5557

generators/src/main/java/com/algolia/codegen/AlgoliaPythonGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void processOpts() {
8585
supportingFiles.add(new SupportingFile("__init__.mustache", packageName + "/models", "__init__.py"));
8686
supportingFiles.add(new SupportingFile("__init__.mustache", "http", "__init__.py"));
8787
supportingFiles.add(new SupportingFile("config.mustache", packageName, "config.py"));
88+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
8889
}
8990

9091
@Override

generators/src/main/java/com/algolia/codegen/AlgoliaRubyGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public void processOpts() {
4242
apiTestTemplateFiles.clear();
4343
modelTestTemplateFiles.clear();
4444

45+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
46+
4547
// Remove some files we don't want to output or change their paths
4648
supportingFiles.removeIf(file ->
4749
file.getTemplateFile().equals("gitignore.mustache") ||

generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public void processOpts() {
7474
var modelFolder = sourceFolder + File.separator + modelPackage.replace(".", File.separator);
7575
supportingFiles.add(new SupportingFile("version.mustache", "", "version.sbt"));
7676
supportingFiles.add(new SupportingFile("jsonSupport.mustache", modelFolder, "JsonSupport.scala"));
77+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
7778
additionalProperties.put("isSearchClient", client.equals("search"));
7879
typeMapping.put("AnyType", "Any");
7980

generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ public void processOpts() {
206206
supportingFiles.add(
207207
new SupportingFile("client_configuration.mustache", sourceFolder, getClientName(CLIENT) + "ClientConfiguration.swift")
208208
);
209+
supportingFiles.add(new SupportingFile("LICENSE", "", "LICENSE"));
209210
supportingFiles.add(new SupportingFile("Package.mustache", "Package.swift"));
210211
supportingFiles.add(new SupportingFile("podspec.mustache", projectName + ".podspec"));
211212
supportingFiles.add(

clients/algoliasearch-client-python/LICENSE renamed to templates/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

templates/csharp/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/dart/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/go/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/java/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/javascript/clients/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE

templates/kotlin/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/php/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/python/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/ruby/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/scala/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

templates/swift/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

0 commit comments

Comments
 (0)