carlspring / carlspring/idempotence

Implement support for SBT

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
enhancement hacktoberfest help wanted
Dominant language
Java
Stars
2
Forks
1
Avg merge
5h 18m
Merged PRs (30d)
6

Description

# Task Description

We need to check if the Maven dependency is sufficient for use under SBT. If not, we need to implement an extension for it.

This is a typical SBT directory structure:
```
your_project/
├── build.sbt # Main SBT build configuration file
├── project/ # Additional SBT configuration files, plugins
│ ├── build.properties
│ └── plugins.sbt
├── src/ # Contains all source files
│ ├── main/ # Main application code and resources
│ │ ├── java/ # Java source files
│ │ ├── resources/ # Resources (files) for the main app (e.g., configs, static assets)
│ │ └── scala/ # Scala source files
│ ├── test/ # Test code and resources
│ │ ├── java/ # Java test files
│ │ ├── resources/ # Resources for tests
│ │ └── scala/ # Scala test files
└── target/ # Build output directory (generated by SBT)
├── classes/ # Compiled classes
├── scala-2.x/ # Scala-specific build output (versioned by Scala version)
├── test-classes/ # Compiled test classes
└── resource_managed/ # Resources generated during the build
```

## Directory Breakdown

* `src/main/scala/` – This directory contains the main Scala source code.
* `src/main/java/` – Java source files for the main application.
* `src/main/resources/` – This directory is where resource files for the main application reside. Files like configuration files (.conf, .properties), static assets, and other non-source code resources go here.
* `src/test/scala/` – Scala test code.
* `src/test/java/` – Java test code.
* `src/test/resources/` – Test-specific resources.

## Where Resource Files Get Copied From and To

**Production Resources**
From: `src/main/resources/`

All files in this directory are included in the classpath during runtime.
To: `target/scala-/classes/`

**Test Resources**

From (test resources): `src/test/resources/`

These files are only available during testing.
To (test resources): `target/scala-/test-classes/`

The test resources get copied to this directory, making them available for test execution.

**Resource Management During Build**

SBT automatically copies resources:

* Managed resources: These are processed and placed in the `target/resource_managed/` directory if you use certain plugins or resource generators.
* Unmanaged resources: These are the raw files you place in the `src/main/resources/` or `src/test/resources/ `directories, and SBT just copies them directly into the target folders.

# Open Questions

# Notes

# Task List

The following tasks will need to be carried out:
* [ ] Investigate whether the `idempotence-maven` dependency is enough for use from an SBT project.
* [ ] Provide a solution.
* [ ] Create a new Maven module called `idempotence-sbt`.
* [ ] Have a look at the code in the `idempotence-gradle` module and follow the same approach.
* [ ] Test the fix.
* [ ] Write unit tests.
* [ ] Add a new Maven module called `idempotence-sbt-integration-tests` and use the scripts from the `idempotence-gradle-integration-tests` module as inspiration of how to implement this for SBT.
* [ ] Create a sample SBT project.
* [ ] Implement tests in a similar way to the ones in the `idempotence-gradle-integration-tests`.
* [ ] Update the documentation.

# Useful Commands

# Incurred Costs

# Task Relationships

This task:
* Is a sub-task of:
* Depends on:
* Is a follow-up of:
* Relates to:

# Resources

# Useful Links

# Points of Contact

* @carlspring

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by checking whether the idempotence-maven dependency works in the SBT directory structure described, then compare the idempotence-gradle module and its idempotence-gradle-integration-tests scripts. Done means providing the idempotence-sbt and idempotence-sbt-integration-tests modules, a sample SBT project, unit and integration tests, and updated documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, scala
Domain
build-system, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.