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

[http-client-java] License generation for client Implementation #6166

Closed
Tracked by #2274
lmazuel opened this issue Feb 26, 2025 · 1 comment · Fixed by #6623
Closed
Tracked by #2274

[http-client-java] License generation for client Implementation #6166

lmazuel opened this issue Feb 26, 2025 · 1 comment · Fixed by #6623
Labels
emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Comments

@lmazuel
Copy link
Member

lmazuel commented Feb 26, 2025

No description provided.

@lmazuel lmazuel added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Feb 26, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 26, 2025
fix #6166

License can be set to unbranded for all emitters (configured in TCGC
Azure/typespec-azure#2353).

Currently Java emitter uses
```
name
link
header
```

`company` is inserted into `header` and `description` by TCGC.

---

User can config e.g.
```
  license:
   name: "Apache License 2.0"
   company: "VMWare"
```
in tspconfig.yaml

It would result to file header e.g. (currently there is a bug of extra
newline in tcgc, that was fixed but not released)
```
// Copyright (c) VMWare. All rights reserved.
// Licensed under the Apache License, Version 2.0.

package tsptest.builtin;
...
```
and license section in pom.xml
```
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
```

---

I am not able to have a proper e2e test, as tsp still cannot support
setting nested property in option via command line `--option
"@typespec/http-client-java.license.name=Apache License 2.0"`
Suggestions are welcome.
@weidongxu-microsoft
Copy link
Contributor

weidongxu-microsoft commented Mar 26, 2025

Will release unbranded java emitter after a new version of tcgc be available (current version there is an unwanted extra newline on very line break).

mario-guerra pushed a commit that referenced this issue Apr 2, 2025
fix #6166

License can be set to unbranded for all emitters (configured in TCGC
Azure/typespec-azure#2353).

Currently Java emitter uses
```
name
link
header
```

`company` is inserted into `header` and `description` by TCGC.

---

User can config e.g.
```
  license:
   name: "Apache License 2.0"
   company: "VMWare"
```
in tspconfig.yaml

It would result to file header e.g. (currently there is a bug of extra
newline in tcgc, that was fixed but not released)
```
// Copyright (c) VMWare. All rights reserved.
// Licensed under the Apache License, Version 2.0.

package tsptest.builtin;
...
```
and license section in pom.xml
```
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
```

---

I am not able to have a proper e2e test, as tsp still cannot support
setting nested property in option via command line `--option
"@typespec/http-client-java.license.name=Apache License 2.0"`
Suggestions are welcome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:java Issue for the Java client emitter: @typespec/http-client-java
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants