Yes capital gain tax would be liable and sale consideration would be FMV of the flat he will give you and amount paid in cash/ cheque.
Cost would be cost of part of land the builder would get in exchange.
Capital gain will be paid in the year in which you get the possession of the flat.
Hope you find the information helpful if you do please rate it 5 and provide your valuable feedback for my improvement.
Thank you.