Registry / utility / sourcecode-2-11

sourcecode-2-11

JSON →
library0.3.1javamavenunverified

Scala library to capture source code metadata like file name and line number at compile time.

<dependency> <groupId>com.lihaoyi</groupId> <artifactId>sourcecode_2.11</artifactId> <version>0.3.1</version> </dependency>
INSTALL
IMPORT
SIG · SOURCECODE-2-11
S
sourcecode-2-11
utilityjavav0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SourceFile
sourcecode.SourceFile

Capture the current source file name using SourceFile.

import sourcecode.SourceFile object Example { def main(args: Array[String]): Unit = { implicit val source: SourceFile = sourcecode.SourceFile() println(s"File: ${source.value}") } }
Debug
Known issues
gotchaScala 2.11 is extremely outdated; consider using Scala 2.13 or 3.x.
fix
Upgrade to sourcecode_2.13 or sourcecode_3.
affects: >=0.3.0
Upgrade
Version history
0.3.1latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
sourcecode-2-11 — mvn dependency:get sourcecode-2-11 · libregistry