Slackbot
07/16/2023, 3:47 PMAdam
07/16/2023, 4:11 PMartifact {}
block doesn’t have a files()
function
dependencies {
implementation("com.twitter:twitter-api-java-sdk:2.0.3") {
artifact {
this.files() // ERROR: Unresolved reference: files
}
}
}
Dennis
07/16/2023, 4:15 PMDennis
07/16/2023, 4:16 PMAdam
07/16/2023, 4:18 PMfiles()
calls Project.files(), which will create a new file collection, which is allowed, but then nothing happensDennis
07/16/2023, 4:18 PMAdam
07/16/2023, 4:21 PMAdam
07/16/2023, 4:22 PMDennis
07/16/2023, 4:30 PMjavadoc
and sources
reference. If there is a way to provide them into the implementation
thing, that would be great!Dennis
07/16/2023, 4:32 PMAdam
07/16/2023, 4:34 PMDennis
07/16/2023, 4:35 PMmain
, javadoc
, sources
and test
. Copied them over to this project. Didn't want to publish.Adam
07/16/2023, 4:35 PMAdam
07/16/2023, 4:36 PMDennis
07/16/2023, 4:36 PMAdam
07/16/2023, 4:36 PMDennis
07/16/2023, 4:37 PMAdam
07/16/2023, 4:38 PMDennis
07/16/2023, 4:38 PMDennis
07/16/2023, 4:38 PMDennis
07/16/2023, 4:38 PMAdam
07/16/2023, 4:40 PMgradle init
to run the auto conversionDennis
07/16/2023, 4:41 PMAdam
07/16/2023, 4:41 PMAdam
07/16/2023, 4:43 PMDennis
07/16/2023, 4:46 PMapi
instead of implementation
, what's the difference? Does it matter?Adam
07/16/2023, 4:47 PM.
└── m2/
└── repository/
└── com/
└── blah/
├── whatever/
│ ├── whatever.jar
│ └── whatever-sources.jar
└── maven.xml
Then you’d add in your project:
.
└── myProject/
└── maven-dir/
└── com/
└── blah/
├── whatever/
│ ├── whatever.jar
│ └── whatever-sources.jar
└── maven.xml
Then add a local Maven directory for that file:
repositories {
maven(file("./maven-dir/"))
}
Adam
07/16/2023, 4:48 PMIt generated withinstead ofapi
, what’s the difference? Does it matter?implementation
implementation
means “I need this dependency to build and run this project”, api
is the same but additionally tells consumers “you need this dependency as well, so I’ll automatically add it to your dependency list”,Adam
07/16/2023, 4:49 PMDennis
07/16/2023, 4:50 PMDennis
07/16/2023, 4:55 PMDennis
07/16/2023, 4:55 PMAdam
07/16/2023, 4:55 PMDennis
07/16/2023, 4:55 PMAdam
07/16/2023, 4:56 PMDennis
07/16/2023, 4:56 PMDennis
07/16/2023, 5:02 PMDennis
07/16/2023, 5:02 PMAdam
07/16/2023, 5:02 PMThomas Broyer
07/16/2023, 5:23 PMimplementation("com.twitter:twitter-api-java-sdk:2.0.3") {
artifact {
url = uri("libs/twitter-api-java-sdk/twitter-api-java-sdk-2.0.3-jakarta10.jar").toString()
}
}
(or something like that)Thomas Broyer
07/16/2023, 5:27 PMdependencies {
components {
withModule("…") {
allVariants {
withFiles {
removeAllFiles()
addFile("twitter-api-java-sdk-2.0.3.jar", uri("libs/…").toString())