Comments (8)
Try with scalaSource
from sbt, like:
PB.targets in Compile := Seq(
scalapb.gen() -> (scalaSource in Compile).value
)
from sbt-protoc.
@BryceCicada almost, it just deleted scalaSource
folder. :)
from sbt-protoc.
Ah, I see. I tried this out on a project used exclusively for compiling .proto files, on which other projects depend. That is, I had no code in scalaSource
so I hadn't noticed this behaviour.
You could try with:
PB.deleteTargetDirectory := false
but then you'd have to do the housekeeping of generated code yourself.
from sbt-protoc.
We are getting closer. Last problem, now compile errors out with duplicate class definitions., because sbt-protoc messes with libraryDependencies
.
from sbt-protoc.
Sad times. I'm not much more help I'm afraid... I've only been a user of this library for a few hours. Hopefully, a more experienced person can step in.
On a side note; I guess you have reasons for putting generated code into your src
folder, but I imagine this is not a well-trodden path. For example, one might typically have own code under version control but not generated code, and then have a build (under version control) that creates the generated code. I guess that's what target/src_managed
is for, if you exclude target
from version control.
from sbt-protoc.
@BryceCicada in my case I need to have all code under source control, including generated one.
from sbt-protoc.
Maybe a subdirectory of src/main then?
PB.targets in Compile := Seq(
scalapb.gen() -> baseDirectory.value / "src/main/scala-protos"
)
from sbt-protoc.
@thesamet hm, this solution is good enough. Thanks.
from sbt-protoc.
Related Issues (20)
- missing scalapb/scalapb.proto when compiling in sbt multi-project HOT 3
- Allow disabling `ScalaPB-Options-Proto` HOT 8
- /usr/lib/dyld: cannot execute binary file error on macOS + nix-shell HOT 4
- Add ability to opt-out of automatic source generation HOT 3
- proto files from external directories not picked up HOT 2
- Options set on transtitive projects are not picked up. HOT 6
- Can't download 0.99.29+ for sbt 0.13 HOT 2
- protoc downloaded twice HOT 2
- Plugin not always triggers scala classes rebuild. HOT 5
- Plugin dependency resolution error on sbt 1.5+ HOT 2
- optional fields not supported HOT 2
- sbt-protoc error File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file HOT 1
- How to generate protos from another sbt-plugin project? HOT 4
- Having trouble using cached protoc binary with nix-shell HOT 4
- Unresolved dependency: com.thesamet#sbt-protoc;0.99.23: not found HOT 2
- .proto files not picked up when not in src/main/protobuf HOT 1
- "has" method not generated for oneofs when not using external "protoc" HOT 1
- Impossible to access javax.sql in custom CodeGenerator
- No jar is generated HOT 5
- name clash: clearExtension HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-protoc.