Tôi sử dụng tiết kiệm và tạo ra một số tệp java (giao diện) trong thư mục build (build/generated-sources/thrift/<package name>/<class>)
nhưng theo số src/main/java
Tôi có các lớp có định nghĩa gói giống như trong tệp java được tạo và lớp của tôi cũng thực hiện các giao diện được tạo ra bởi tiết kiệm vậy làm thế nào tôi có thể cấu hình này trong build.gradle tôi để nó hoạt động trên i ntelliJ cũng như xây dựngLàm cách nào để thêm thư mục nguồn được tạo vào đường dẫn nguồn của tôi trong Gradle và IntelliJ?
plugins {
id "org.jruyi.thrift" version "0.3.1"
}
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "org.jruyi.thrift"
group 'com.hello'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.5
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.apache.thrift', name: 'libthrift', version:'0.9.3'
compile 'com.datastax.cassandra:cassandra-driver-core:3.0.0'
compile 'com.datastax.cassandra:cassandra-driver-mapping:3.0.0'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
compileThrift {
thriftExecutable "/usr/local/hello/bin/thrift"
sourceDir "src/main/thrift"
createGenFolder false
}
task thrift(type: Exec) {
commandLine '/usr/local/hello/bin/thrift'
}
compileJava {
dependsOn 'compileThrift'
Tiết kiệm có tạo ra các nguồn thông qua gradle không? – acdcjunior
có. Tôi đính kèm tập tin gradle của tôi – user1870400
Làm thế nào về: 'sourceSets.main.java {srcDir" $ buildDir/tạo ra-nguồn/tiết kiệm "}' – RaGe