gleam-lang / rebar_gleam Goto Github PK
View Code? Open in Web Editor NEW๐งฐ Build Gleam code with rebar3
License: Apache License 2.0
๐งฐ Build Gleam code with rebar3
License: Apache License 2.0
Hi!
When running rebar3 compile
and then rebar3 eunit
immediately after, this error appears:
$ rm -rf rebar.lock _build/ gen/* && rebar3 compile && rebar3 eunit
===> Fetching rebar_gleam v0.1.0
===> Analyzing applications...
===> Compiling rebar_gleam
===> Verifying dependencies...
===> Fetching gleam_stdlib v0.16.0
Compiling resistor_color
Compiling gleam/string_builder
Compiling gleam/should
Compiling resistor_color_test
Compiling gleam/pair
Compiling gleam/atom
Compiling gleam/bit_string
Compiling gleam/bit_builder
Compiling gleam/io
Compiling gleam/order
Compiling gleam/int
Compiling gleam/list
Compiling gleam/option
Compiling gleam/regex
Compiling gleam/result
Compiling gleam/map
Compiling gleam/queue
Compiling gleam/set
Compiling gleam/float
Compiling gleam/bool
Compiling gleam/dynamic
Compiling gleam/function
Compiling gleam/iterator
Compiling gleam/string
Compiling gleam/base
Compiling gleam/os
Compiling gleam/uri
warning: Unused variable
โโ /home/michal/projects/exercism-gleam/exercises/practice/resistor-color/src/resistor_color.gleam:14:13
โ
14 โ pub fn code(color: Color) -> Int {
โ ^^^^^^^^^^^^ This variable is never used.
Hint: you can ignore it with an underscore: `_color`.
Done!
===> Analyzing applications...
===> Compiling gleam_stdlib
===> Analyzing applications...
===> Compiling resistor_color
gen/src/resistor_color.erl:19:6: Warning: variable 'Color' is unused
===> Verifying dependencies...
error: Duplicate module
The module `resistor_color` is defined multiple times.
First: /home/michal/projects/exercism-gleam/exercises/practice/resistor-color/src/resistor_color.gleam
Second: /home/michal/projects/exercism-gleam/exercises/practice/resistor-color/src/resistor_color.gleam
===> Unable to compile Gleam project
Project: https://github.com/exercism/gleam/tree/main/exercises/practice/resistor-color
Gleam 0.16.0, rebar 3.16.1, erlang 24.0.2
Just installed everything. I can get gleam to compile but I see this when I run rebar3.
===> Plugin {rebar_gleam,{git,"https://github.com/gleam-lang/rebar_gleam"}} not available. It will not be used.
I'm looking to write a new rebar3 plugin for the new compiler API
The API is to be called once per Erlang application within the project, starting with the left applications that have no deps, up to the root, so that dependancy modules are compiled before dependant modules.
It looks something like this:
gleam compile-package \
--name app_name \
--src directory/containing/gleam/files \
--out directory/to/write/to \
--lib path/to/out/dir/of/dep \
--lib path/to/out/dir/of/another/dep # ...etc
It reads metadata files from the --lib
directories for type information from already compiled Gleam applications, then it reads all the Gleam files from --src
, then it writes compiled Erlang files and metadata files to the --out
directory.
I have been looking at the rebar_compiler behaviour, but it seems to be focused on compiling individual files, but the Gleam compiler operates at the application level.
https://github.com/erlang/rebar3/blob/dd9b8b1f41520c307f08b6005eb77ce70d54ee42/src/rebar_compiler.erl#L34
I found a project_builder
concept here. It is just a build/1
function that returns ok
or an error tuple.
How does the project_type field get set? https://github.com/erlang/rebar3/blob/73aa64fb342ef76bf6fc4d1734c6df711bebe5ab/src/rebar_prv_compile.erl#L326-L339
How do we invoke the normal rebar3 build process after the Gleam project builder has run?
@tsloughter If have a spare moment I would be very grateful if you could share whether you think I'm going in the right direction. Thank you! ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.