How I set up all my #SBT projects

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thank you for the interesting post! Unfortunately, sbt throws an error when I try to create a new project from your template. Any thoughts?
Exiting due to error in the template

relative: core/src/test/scala/$package__lower,package,packaged$/$name__lower,word$/.keep, toPath: ./hello-zio, 1:52: mismatched input '$' expecting COLON

👍︎︎ 1 👤︎︎ u/uralian_snark 📅︎︎ Nov 30 2019 🗫︎ replies
Captions
hey Vlad hear them inside it out come welcome to another video so I was setting up a project recently and then I realized that it takes so much time to set up the SPT with all the settings and with all the plugins the way I like it and so I decided to make a video about how I set up all of my projects but then I realized that it would be really really boring to watch and so instead I created a jitter rate template and if you don't know what jitter it is I already have three videos about this and so today what we're gonna do we're just gonna go and install it and then we're gonna play around with it I'm gonna show you around what it can do and also we're gonna go through the build itself and I'm gonna show you a few basically a few SBT tips and tricks and even though this video is not gonna be about you know has beauty tips and tricks or it's not gonna be cold you know the 10 best plugins that you need for SBT you will actually end up learning a thing or two so without any further ado let's get that [Music] as always i'm using an ubuntu 1804 virtual machine and using Windows as a host and I'm using the virtual desktop feature from Windows that allows me to switch between my data back and forth so for example like this I'm on Windows and like this I'm back in Abunda so the first thing we're gonna do is we're actually gonna go back to Windows led like this and we're gonna go to g8 dot dem inside account which is a subdomain that I have for all my generate repositories one is for cleaner architecture that we have created in these three videos and this one is this Scala seed so we're gonna go and gonna click on it and I'm actually going to increase the whole thing a little bit 125 percent like this okay so as you can see this is a generators bTW Scala templated enter a template for a fully configured Scala SBT single but multi build ready project it is configured in a slightly open e opinion opinionated but also dependency free fashion now what I mean by multiples already project is that every time I'm supposed to find a setting I'm doing you know this build slash right so so that if you add you know some sub projects then you don't need to go and change you know the whole thing okay so it's ready for a multiple but as a Fred now it's just going to be a regular single build and it's opinionated and older versions will always say hard coded as opposed to being choosable or automatically updatable viage iterate so generate can actually pull down the latest version from for example you know over here it is hard-coded to use SBT version 1.3 to but I could have configured it in such a way that it would just go to maven and suggest you to use the latest the latest version but the whole point of this of this whole thing is that I want to make sure that it that it basically never breaks right so as it sounds over here it says in order to guarantee the soundness of the built in other words assuming that you don't have any global settings or plugins they build won't break unless you manually break it by changing versions by hand enjoy right so the idea is that you know from from time to time we'll come back to this thing and I will update it with new things with new cool tricks and by the way if you know if you cool as 50 things or it's uncool as beautiful as you always use please let me know down in the comments below okay also SP do you want 3-0 has released this super shell feature which I believe doesn't really work well for a small project because for small project it basically ends of flickering all the time and also there is currently a tiny issue was generated so usually you would just go and you know generate this usually is built into SBT these days so you can just say SBT new and then some github username or you know github organization name like this and then the repository name which usually ends with g8 however in this case it actually collides was super shell a little bit so at least as of right now we need to do this I'm sure it's gonna be fixed in the future and then I'm gonna update this readme and you will be able to just say SBT new dev inside you Scala cg8 so as a Fred now I'm just gonna copy that I'm gonna go back over here I'm gonna go open the terminal I'm gonna go into my dev folder which is currently empty I'm just gonna paste that in here I'm gonna wait a few seconds and then I believe the only variable that I have there is basically just you know just a name of the template and I'm just gonna call it uh yeah I'm just gonna call it whatever whatever project like this and it's gonna be calm dot dev inside you that's pretty much all that it once from you everything else is pretty much hard-coded so I'm going to open this how did I call it whatever whatever project animals are gonna close the terminal like this so the first thing that we're gonna do is we're gonna go and we're going to enable metals because I actually have disabled it from a previous video so we're gonna go and enable it metals like this way actually where she don't really need it today but so I want to enable it just so that I can show you that you know the way the build is set up right now it's gonna for work just fine with metals okay so it actually woke up I'm gonna import the build and press ctrl shift and E so that it shows me my project that make sure you're gonna close this tab okay so we have some output over here in fact you know today we're probably gonna look at the output output a little bit more so while it does this whole bloop thing I'm actually going to start showing you a few things so the first thing that it has it has the SBT da UPS right so it says just a few a few Java Java settings you know you can go and change it by the way you know guys you know if you want to use this thing you know for kit you don't do whatever you want well that the the the typical disarrayed permission is very very well permissive okay so one of the things that you need to know about it let me open the console okay so I'm just gonna go into SBT and you know I'm just gonna I'm just gonna let it load for a bit I sped this up and post but you already saw that there was a little bit of Super Show here's the thing that SBT is very recursive right so it starts with Z was a global settings and it goes into your you know into the project folder setting and so on and so on and so on okay so you can have these settings on in these in this layer so to say and I just said that I don't like it so I disabled it in the you know in the build which is gonna which is what I'm gonna show you later and also I disabled it in the project in the project pilots right but I didn't disable it in the global thing and the thing is that I don't like to have global plugins and global settings because I'm always switching between different projects and they always have you know different versions and different SBT versions and whatnot and occasionally it happens that you know I cloned some repository and then I can't even started because in my in my global plugins in my global settings I'm assuming a higher version of SBT and then it just collides with each other and just doesn't so essentially my global stuff prevents a repository from from start and and you know there are there are workarounds for this you know I could say you know if version blah blah blah but in my experience it just takes you know way more time to maintain okay so as you can see one of the first things is that it shows you a bunch of Alice's so there's a file called analysis that SPT and by the way if you're sort of you know relatively new to SBT LVT doesn't care how you call your files as long as they're called data is picky so you can actually split your built into multiple files so I created a file called Alice's data speedy and we're gonna go through that a bit later right as of right now I just want to show you you know the effect of all of these things okay so you see alice is right so you can do CD and it will jump into some project right right now this is just a single build so I can do CD whatever project and it will you know just switch into it okay I can just go route which is gonna do basically the same thing so if you have sub sub project you can always just up and root it will go back to the main one you can see instead of compile and you can type CA instead of test call and compile right so CA basically compiles your product your production code and your test code okay so I can just do CA it will compile everything okay so the template also comes in was a tiny main method so you can do run and you can also do tests okay there's just uh you know just one test to you know just a hello world to it to demonstrate the next thing that you see is that the prompt is a little bit different so usually this part is you know in science and I want to eat the project especially if I have sub projects I want the product is a project to be to be highlighted so I just moved it a little bit okay another thing that it comes with is it comes with with SBT get plugin right so basically I'm inside of as bt right now but if I if I type something like get in it for example it will actually understand that okay this is a good command and it will sort of underneath you know go into the shell and ask and that's good to do stuff so I can do get in it okay and as you can see it worked and I can do git add everything and I can do a git commit - I am I say initial commit now before I press enter so it will add all of these files into into this repository and notice that there is also a git ignore file so these ones are already grayed out the bloop metals target and there's there is only there's only IntelliJ or so that idea in there okay but as soon as I press ENTER it will actually include the the branch and the the hash of the current commit into this prompt over here so let's see I'm pressing enter it added all of the files I look how the prompt looks like now right it says get column and then master and call it and then hash and then call an SPT colon and then the name of the project okay so her press Enter it's just gonna keep saying that okay ctrl L so this is this is how the prompt is going to look right now and also I change the the continuous compilation prompt the case if you do if I do tilde and I can just to see instead of compile write because this was one of the aliases right so if I if I go back to root it will reload the main project and it will show me the aliases also SPT has this built in actually if you just type alias I believe yeah alias it actually shows you basically the defined aliases but the description is different right because over here I chose the description that I wanted res for example here say compiled all about what it actually does behind the scenes tasks calling compile okay so we have these aliases let me press ctrl L again and what I can do is I can do it till the C instead of till the compile and the output is going to look like this right so first of all its gonna show me the command okay so basically it means that if I press ENTER and if I do by the way this isn't as bitty bug that it has this space over there okay so if I do for example call on test and then let's say that after test I want to run some stuff and by the way since SPT 1.3 you don't need a you don't need a semicolon over here which is great okay this was killing beginners okay so if you do for example this then it will actually see this over here at such it shows you the command that you're running and it says monitoring source files for and then basically this prompt is exactly the same and it has three dots over there right so the the prompt actually you know this continuous compilation prompted actually changed in in SBT one two three so the usual one actually I can I can show it to you so if I go to SBT Dada's PT which I'm gonna show you later I can actually go and disable the setting okay so I believe it starts over here and it ends over there all right so I'm gonna do that by the way notice that this is continuous compilation and notice that as soon as I save this file it should actually notice yet notices I keep my medals I don't care about miles okay so it noticed that and reloaded that so this is another setting that I have set up that I have actually showed to you in the previous videos as well okay so this is a default prominence as you know the default continuous something prompt it says monitoring source files for whatever project test whatever project from and I press and go to interrupt or a question for more options so you can always do you know question right whoops not there over here just question and it shows you that you know this is a new thing in SBT right so if you do for example are without pressing enter you know just-just are some this is my right hand and just pressing R and actually it reruns the command okay so only because you don't see this right so if I if I go and re-enable this thing again like this only because you don't see this it doesn't mean that you compress it okay so I can still do a shift you know come on over over there if I do if I do that I still see the option started so press R it certainly runs the command if we run the command runs a command actually let's go do let's go do this was was wrong okay I can just press R it really runs three runs three runs three runs also there is a setting in SBT which basically says that if nothing changed then it shouldn't you know reduce that fret so for example if you do like this continuous running so if we go to my main method you know over here come on okay so if I do this so if I press save usually as BT does not does not rerun it because it notices that actually nothing changes this is a setting and I set it up in such a way that it always runs because I'm recording tutorials and they know I just want to have you know I just save something and I just want to show it to people yet another thing is that notice that every time in reruns it actually clears the the screen let me should go into as putida SPT and this is one of these settings it's it's this one right so if I disabled add that notice what's happening here right so if I go if I go to mean okay so if I say now okay hold up maybe it's another one maybe it's this one I always confused them hold up like this okay as you can see it doesn't clear anything before like all of this stuff still remains there but as soon as I have these I'm not sure why they have to actually anyway because I couldn't I couldn't actually reproduce one of these right so it basically it clears everything that was before right so basically presses like control and at control L right but I can actually still scroll up and I can see all of the stuff that was there before which is really super cool it's really convenient you know when you're recording especially tutorials or you know or if you want to basically see the latest iteration all right so let's one of the first things that we're going to show you is that we're gonna go to get ignore right so basically just has blue by da medals and target it has scour FM t config would say very you know it's very modest config there's basically not much in there I'm gonna close that right so I'm just doing the center library straight margin for for string interpolation you know for the for the raw strings and I would like to sort the modifiers and I preferred curly force this is the way I like to sort the modifiers and this the setting basically allows me to have methods with multiple parameter lists and formatted in a very beautiful way if you have seen my scholar fmt video you will know how it looks like okay let's actually go to plugins plugins so first of all inside of the plugins this is you know this is like another layer of SBT you know the one that is before your actual project and over there I usually specify the version manually right because it's just sometimes happens that for example my project is on 212 let's say 212 8 and then I'm I'm downloading a project which use this and and sort of like an older SBT version which still uses you know 212 itself you know because SBT is written in scala right so downloads it and then it says okay III didn't I didn't compile the the scholar for SBT yet because you know because it needed to twelve six for example right so for this I was like I will set up exactly the same version as I'm using or basically the latest version that has bit he can handle because as of right now 213 one is already out but SBT is still on the two twelve right in fact as of right now you know with SBT 13.2 this is you know the setting is there anyway right so they're actually right now on to twelve ten but for example let's say let's say two months from now to twelve eleven comes out right but as VT still uses two twelve ten but all of my projects are already on to twelve eleven so if I specify it over here it's just gonna build faster you know this one time you know I don't want to go too OCD on about this okay I'm also I'm also setting the the super shell to false even in this sub layer I'm also not allowing it to start the server even an assembler and I'm doing this because of and because of this play and SBT updates so what SBT updates allows you to do is if I go to my alias is actually have one alias that basically it will go to the plugins project it will run the dependency updates command which basically will tell me if there are new versions of plugins then it will go back and we'll run the dependency updates in my actual project and every time it goes into the plugins right these settings that I just showed you they will apply so it'll basically start the SPT server and so and I don't really need so this is why I have these these settings over here let's look at the plugins so we have Clippy I made a video but clip you basically you know in highlights your error messages and you know gives you advices I have SBT updates as I will demonstrate in just a second I have SBT kits but I'm not using it much right so basically I'm using it to allow me to go you know through SBT in to get it actually can add prompt a prompt for you but I should have created you know this whole prompt that you have seen in the one was get I've actually created it manually and you know as Escala fmt because I sometimes prefer to around scale fmt directly from SPT and then it will just format the whole thing let me show you this dependency updates thing okay so I can press ENTER over here let me have more space over here control l so what I can do is I can say actually collapse this thing okay I can say up to date right so what will do it will go until into the plugin thing alright so see there's already mister so we can actually maybe maybe it maybe fix it now where is it Elias did I type something here okay so I reload plugins to pass your eminency updates what does it say not a valid key dependency updates really deep end and see updates so inside of project that told me that I can't do that I should I should have been able to do that maybe maybe maybe hold on okay so I need to go into planes maybe I need I need to have this plugin also one one layer below so inside of this one the purple is great and over here plugins done because see when I built it I actually had the dependency updates plug-in in my in my global settings and as I already mentioned like I don't I don't like to have this and so I removed it afterwards but I believe if I did I believe if I did this okay so let me go back in like this [Music] okay let me to control and let's try it again up to date all right something is happening yeah so now it works so it basically needs it also to have it like one layer below I'm gonna add it to the to the jittery template and in just a second okay basically I'm gonna do this off camera because you don't really care about this okay so if I collapse that and do that so as I can see like in my projects right so in my in my plugins you know for you know this is the version that has bt is using right so SBT 1.3 that 2 uses this version but it tells me that technically it could use 213 one however if I try to set this to 213 one health PT is actually not gonna work right then it reloads my actual project right which is why we see these aliases and it's it tells me the same thing over here right so as of right now my project is on 212 eight because clip is still on 212 eight right but it already tells me that you know that there is actually a newer version of the scala library right so as of right now and basically have almost no dependencies over here in except for testing dependencies I'm gonna show you them in just a second but all of them are up-to-date therefore you don't you don't see anything in there maybe actually we can go and change some of them so I have a file called dependencies maybe we can go and worry Scala tests so we can maybe set it to 3 or 5 all right so if I run up to date now notice that as people should notice that that something change in my build files so it it reloaded that no it didn't it didn't it didn't change it didn't do that because it changed in the in a dot Scala file and not in a in a daughter's pitiful oh no I did it did that I just didn't see it so I did it didn't even need to reload it ok so as you can see it's a you know the up-to-date thing tells me that there is a new version of Scala test rights which is 308 so let's do that ok let's for example run the test and yeah yeah all right yeah as you can see okay I reload and test ok so sometimes it doesn't know at the SPT 11.3 or two sometimes it doesn't notice that there's a change in a dot scala file and sometimes it does ok in the dot Scala you know built afar okay all right let me see if I have forgotten to show you something so we have we have the plugins over here we have the plugins one layer above which is over here right so we have two of them one is one is over here and one is over there okay let's collapse them okay so one is over here one is over there okay so I showed you this I showed you SPT Scala well that's not okay you can tie Scala empty okay great it's formatting one scout source okay um what else let's see okay so I showed you all of the plugins let's see okay so in the project folder I have the dependencies that Scala file it's a very small file and basically imported SPT and you know again if you're not super familiar with SBT basically you can have data spitting files somewhere like here and then you can have dot Scala files one layer lower but but they but they essentially end up being on the same layer right so SBT data speech he files from here can talk to dot Scala files that are that are lower right so if you have something that you're reusing between your data SPT files you put them into dot scala files right so for example this object dependencies I can access it from from from all of these SBT files right however if I put in one of the SBT files I will not be able to access it from from another one okay so I'm not sure if there are any conventions over here but I like to group my my dependencies you know I could obviously group them by the group ID but I actually prefer to group them semantically right so these ones are the test settings notice also that I prefer to call my vows exactly how the library is called and this way you know I don't have to do any weird mind mapping I also have a group for compiler plugins but I notice that the test dependencies over here they don't do they don't do this they don't do that or they don't do that right I'm doing this manually in the build because occasionally depends on what I'm doing I sometimes actually have them in the product introduction scope okay let's see what else do we have so we also have the same as dependencies that Scout we also have util that's Carla right because again it's just like stuff that I want to be able to access from SPT files so if I go in there and by the way the version of SBT that we're using is one let's read it too so if we go to two util right so one one them is this discolor right so for example let's say let's say that you don't like this whole sign color let's say that you like magenta you have you can change it in this one spot and everything else turns magenta right so if we ran the tests for example okay again this is a change in adults caliphal so as bt somehow did not notice that there was a change okay so now everything should be magenta instead of instead of sign okay as you can see yeah let's do that see okay everything is not it's not magenta right so this is your preferred I should prefer magenta but SBT by default use this sign for for this for this arrow thing and so you know I ended up using it as well okay let's reload again let me close that okay now this is the the fancy prompt right so for example if you don't like the prompt you can change them here so if you don't want you know SBT column you can do whatever you want style is again it's just this method was the it was the color right so you can do you can put whatever you want in here okay this is the get prompt so if you don't like you know this whole get column blah blah blah you can change it this is how it gets the these stuff by the way notice that I'm not using you know it's it's not because I'm using the the SBT get plugin what I'm what I'm doing is I'm actually using the assists now what is called this process library directly from Scala and basically I'm going straight to the shell and I'm running a command like this right so basically a command comes it comes over here it splits it by by spaces it converts into a sequence and then from this system and process that system what was it again this process thing there's an implicit in there that basically adds to a sequence of string this method over here right and then I'm trimming the output and I'm also passing in this knob process logger right so basically if there is if there's input input stuff I just want to delegate it to to nothing right because I was I was seeing some side affecting things in fact maybe I should show it to you so for example if I don't do that okay then if I don't have a git repository or as if I go over here and I remove the dot get over here at so fast RESP T so as you can see I have a try I have a try here okay right so basically if something fails you know if I can't manage to retrieve the the get information it will actually you know just just just just having none there right but as you will see in just a second so this is not a git repository anymore because I removed the docket folder however it says is fatal not a good repository okay so even though you know even even though I have I have this try thing around it I still see this side affecting thing and this is why I went and I created this not up process logger which I can pass in over here right like that and as we have seen in the beginning I it's actually not not showing though right so again this is not a git repository so if you tries to get the branch and stuff right so it just swallows there's there is no output this is why this is why I created it okay actually let's go and create the repository again and get in it and get emit I am alright I just want to you know I just want this prompt okay let's see what else so over here I have shown you everything okay so there's pretty much everything that is in the project folks so in the very lowest one we have the plugin says PT which adds the SBT updates one layer above we have the build properties which is 132 we have these four plugins and very few settings then we have the dependencies and just a couple of them and we have util which basically mostly just the prom stuff on the color stuff okay so basically pretty much done with this layer let me close all of these like that okay so after I have shown you get ignore I have shown you Todd SPT ops I've shown you Scala empty config I only haven't shown you these guys okay so the first of all first one is Clippy and the same as in the video that we have seen about Clippy basically I want the colors but I don't want the syntax highlighting in the in the actual code so I want to see the error message in the rad maybe I can actually show this to you because maybe haven't seen the the Clippy video in the case of a good to me and basically if I if I remove that and just create something like source and I'm gonna say that this is a list of a set of a map of double and int okay and I don't care about the implementation and now I can say target and I'm gonna say that this is a list of let's say array of map of double and end like this and I'm gonna say that this is a source okay so if I go and try to compile it like this then clipping will highlight the difference in in rap right so this in this case it's sad and it's the array but it doesn't have any syntax highlighting over here because I basically went and I disabled it in the Clippy file okay so basically I went over here and disabled all of that right so if I don't have that and again notice that as soon as I save it because this is daughters PT file it will reload and now it will have syntax highlighting over here and I don't really like it because I really just want to see the arrow okay I'm gonna revert that like this okay so this was the the clipping one and let me also fix that basically I don't want them okay okay so let's look at the aliases right so these are the Alice's is basically a bunch of comment area that comment le SS comment yes right a bunch of these nothing nothing major except for this up-to-date thing because it goes into this weird real old plugins thing this is the onload message right so this is the message as you see so this is just a bunch of fancy ASCII ASCII things over here to make this whole thing look like a table and over here notice that it calls into this style method and therefore it imports this util thing in which I can't jump into okay util it's called the styling rights because it's in adults caliphal one layer lower I can actually access it from here okay so this is basically aliases for example if you don't want this message you know just remove that what else the only two things are left is built at SPT and SBT that has be to use ever go to build data sweetie there's there's pretty much nothing there is just you know the sin of self-organization Scala version and you know the version of the project then there's a name and I'm adding the compiler plugin you know the client projector plugin if you're not familiar with it just don't worry about it and I'm also enabling partial unification because we're still I'm still using Scala 212 because of Clippy in Scala 213 it is actually enabled by default so I'm adding all of the you know testing libraries and I'm having a few Scala see options and I'm disabling a couple of them and when I go into the console which is just pretty much you know fatal warnings and worn unused because otherwise you get to see them all the time right nothing major here deprecation feature all the language features partial unification has already said warn me about everything and do not compile if you see a warning okay I also included this CC ett thing basically if you have sub projects right so if you have any which is a project and a and then you have the same thing was being be be then you can say over here it depends depends on a but you can also say a and then the CC TT okay basically make sure that the compiled code depends on the capacity up and the tests go up also depends on income Pascal on the test code okay like this because by default is just compile compile right so essentially you will not be able to access stuff from the from the a test okay I'm talking kind of too much okay so yeah so this is basically a very very simple build file just a couple of settings and the last one that is left is the SBT SBT okay so this is basically all the cool things that that SPT SPG has so this one basically allows this whole reloading of the build file right automatically I don't like to have a parallel execution of tests I find that this is a premature optimization I said a few options for Scala tests I believe this is a short stack traces and I want to see duration of the test right so every time I'm running a test I see a duration right next to it see this 18 milliseconds this comes from this D thing and if there is an if there is a stack of or another stack flaw if there's an exception I see shorter stack traces this - o is just basically a setting from skeletons basically they said that that these two are modifying the output right so these s and D are applied to the output okay what else out of start server false turbo is also an interesting one I came was SBT 1.3 so before what what SPT would do it would I believe take the the the standard library and it would it would use one class loader to load it and then it would use a different class loader to load all your stuff and all of your dependencies and therefore it would basically be faster because right because basically it keeps the JVM warm was a standard library he doesn't need to to load it all the time right so basically this one layer that is already and we store it basically added yet another layer so now you can have the center library in this one layer with one class loader underneath it you can have all your dependencies with you know or you know with a different class loader and then underneath you know all of your stuff right so basically it will it will consume a bit more memory but it will keep more of the JVM warm and therefore you know you can have a better experience if you run into any issues just just disable it clean the project you know throw it out as a friend now the setting is actually experimental super shell I don't like it it also has this setting include plugin resolvers which i couldn't actually reproduce but actually what happens sometimes is that you have a plugin that it's not published in maven but it's published somewhere else so you add a resolver for that play but then if you want to use this plugin you actually also need to have the same resolver in your in your build files right for some reason the river if you plugins that that actually need that right so basically you end up having having to include the same resolver twice and if you have the setting apparently then if you have that in you know the this result way in the plugin it will also be taken in the in the regular build file i couldn't reproduce actually that it works but apparently apparently does in fact i could have used this myself a couple of years ago when i created a plugin at work right so hey I had a plugin for all of our projects at work and it had a couple of resolvers for our own name and repository right unfortunately I still needed to copy paste this resolves into every SBT file and this setting is supposed to help was exactly this situation okay these ones are the one that that clear the output every time you do continuous compilation this one makes sure that it reruns your continuous command even though there are no changes right maybe we can actually set this one to four or just comment this out okay for example if I do call till the run over here if I go to main right notice I saved the file but nothing is happening see I'm saving I'm saving it it actually flickers why does it flicker how long reload it should not flicker hold on mm-hmm maybe four run it always does that no hold on why does it flicker maybe it only doesn't maybe maybe sorry for compile although why does do that maybe should maybe I should explicitly set this to false false maybe there's okay okay now it came down oh okay maybe there are also time time steps time stamps involves okay so sometimes it still leaks through but in any case I in most of the times I want I want to have it enabled anyway so I wanted to always do this right as always see so now it always flickers right over there it was only flickering sometimes because probably there are time stamps involved in the decision-making of whether the file changed or not but yeah I don't know maybe like every 10 seconds it's things okay that that even though the hash code of the file is the same but like a few seconds passed then I'm still gonna reload it or something like this maybe there's something some magic logic in there okay let's see okay so this is the shell prompt right so basically it's kind of weird so it gets in in the state and so it wants a function from state to string right so state comes in and the string comes out and I'm using like my helper function from from util to produce this prompt right so you can change it to whatever you want and this is the prompt for the continuous continuous compilation stuff writes is basically it also wants a function from this tuple which contains the interation and the project graph and the commands to some to some string okay so this is this is what you have so this is what it has you know this is this is the thing that you see over here that's said this is this this prompt okay so the first line is this says it shows the tilde and then all of the commands right so for example if you do and I would say let's do something stupid let's to compile and and then compile all and then and then run okay so basically it basically has them all of them here so it's commands map and then maps them to style whereas we see them live inside but in between you have the white stuff yeah what else monitoring source files it reuses the same over here I believe I actually have have shown you everything already maybe I've forgotten something oh yeah in the tests in the tests I have the test suite that scallop right so this is how I usually set up my tests so I have a trade test suite and I'm using the fun suite it basically allows me just to have let's have it down here like this okay so let's open the suite again over there close all the others collapsed collapse that okay so I have this test suite and I'm extending fun sweet fun sweet it's is functional sweet basically it allows me to always do tests and then just besson the name this is just a simple current function and then in the second parameter I can actually pass on the test I'm like to I like to use master so instead of saying assert and then expect it actual I'm like to use these like should be things it includes before and after all before and after each so if you have you know some setup and teardown things and also it includes Scala check properties right so this over here you know over here you can actually write you know for all and for all whatever acts how does work let's say for all for all ends I want to say I'm gonna say that X plus X should be that's something weird I actually I actually don't have a good example for this maybe let's do for Strings yeah let's just strings let's do us to s1 which is a string s2 which is a string and let's say that if you do s1 length plus s 2 dot length and it should be greater or equals I'm not actually sure that I can do that like this was Scala test let's see greater or equals s1 dot length I don't remember the exact syntax something is already complaining mmm like this like this I don't remember the exact same things but basically you know this whole Scala tech stuff is gonna work ok so let's actually revert everything over here like this I believe actually that I have shown you everything already yeah it ran yes in the main we just have the main main this test suite an example yeah I believe actually I believe actually that's it yes I'll take it for a spin just as a reminder you just need to go to g8 type inside real calm and it will show you the these tomb all right so it's a scholar sieve then I'm gonna fix now was this dependency update thing and yeah all you need to do is to paste that and then or you know you can fork it and adapt it to all of your needs and yeah I believe that this is pretty much all I wanted to show you today I hope that this was not a very long video as most of my videos long so I'm glad I'm inside you I'll come don't forget to like this video if you did subscribe if you want to improve the developer inside you and if you learned something today can set a support me on patreon but most importantly take care
Info
Channel: DevInsideYou
Views: 4,735
Rating: 5 out of 5
Keywords: software, soft, development, dev, engineer, engineering, tutorial, tutorials, program, programming, code, coding, learn, learning, study, studying, motivation, know how, how to, write, education, knowledge, diy, do it yourself, inside, you, dev inside you, sbt
Id: nD-p-cEKjHE
Channel Id: undefined
Length: 38min 30sec (2310 seconds)
Published: Sat Nov 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.